diff options
| author | Tom Christie | 2012-10-03 10:51:38 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-03 10:51:38 +0100 | 
| commit | 36b58d0c78a065c273a19eeb4f4d6d5a2b92d425 (patch) | |
| tree | 585c96adc10ed9aa41f6ccf0bd7900148d988693 /rest_framework/tests/models.py | |
| parent | d8b05201edde0dd3b22d3b57ebeb04a2ed533b95 (diff) | |
| download | django-rest-framework-36b58d0c78a065c273a19eeb4f4d6d5a2b92d425.tar.bz2 | |
Many2Many test
Diffstat (limited to 'rest_framework/tests/models.py')
| -rw-r--r-- | rest_framework/tests/models.py | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py index 7429d863..c90668ca 100644 --- a/rest_framework/tests/models.py +++ b/rest_framework/tests/models.py @@ -28,9 +28,25 @@ from django.db import models  #             'pk': self.id  #         }) +class Anchor(models.Model): +    """ +    A simple model to use as the target of relationships for other test models. +    """ +    text = models.CharField(max_length=100, default='anchor') + +    class Meta: +        app_label = 'rest_framework' +  class BasicModel(models.Model):      text = models.CharField(max_length=100)      class Meta:          app_label = 'rest_framework' + + +class ManyToManyModel(models.Model): +    rel = models.ManyToManyField(Anchor) + +    class Meta: +        app_label = 'rest_framework'  | 
