diff options
| author | Ben Timby | 2012-01-18 22:59:30 -0500 |
|---|---|---|
| committer | Ben Timby | 2012-01-18 22:59:30 -0500 |
| commit | 0a5ca000edcd8fba1e5e5f71c7267d9f52e456a0 (patch) | |
| tree | b7ce62d60bc0aebc889a15cc6bd473d0a3ea8af1 /djangorestframework/tests/models.py | |
| parent | 5f4096ca28d6c0b9ea98f43278789b38cf0d37bb (diff) | |
| download | django-rest-framework-0a5ca000edcd8fba1e5e5f71c7267d9f52e456a0.tar.bz2 | |
Docstring/whitespace fixes.
Diffstat (limited to 'djangorestframework/tests/models.py')
| -rw-r--r-- | djangorestframework/tests/models.py | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/djangorestframework/tests/models.py b/djangorestframework/tests/models.py index 39ac59e7..4cae68b6 100644 --- a/djangorestframework/tests/models.py +++ b/djangorestframework/tests/models.py @@ -1,28 +1,28 @@ -from django.db import models
-from django.contrib.auth.models import Group
-
-class CustomUser(models.Model):
- """
- A custom user model, which uses a 'through' table for the foreign key
- """
- username = models.CharField(max_length=255, unique=True)
- groups = models.ManyToManyField(
- to=Group, blank=True, null=True, through='UserGroupMap'
- )
-
- @models.permalink
- def get_absolute_url(self):
- return ('custom_user', (), {
- 'pk': self.id
- })
-
-
-class UserGroupMap(models.Model):
- user = models.ForeignKey(to=CustomUser)
- group = models.ForeignKey(to=Group)
-
- @models.permalink
- def get_absolute_url(self):
- return ('user_group_map', (), {
- 'pk': self.id
- })
+from django.db import models +from django.contrib.auth.models import Group + +class CustomUser(models.Model): + """ + A custom user model, which uses a 'through' table for the foreign key + """ + username = models.CharField(max_length=255, unique=True) + groups = models.ManyToManyField( + to=Group, blank=True, null=True, through='UserGroupMap' + ) + + @models.permalink + def get_absolute_url(self): + return ('custom_user', (), { + 'pk': self.id + }) + + +class UserGroupMap(models.Model): + user = models.ForeignKey(to=CustomUser) + group = models.ForeignKey(to=Group) + + @models.permalink + def get_absolute_url(self): + return ('user_group_map', (), { + 'pk': self.id + }) |
