Skip to content

Commit

Permalink
Attempt to reproduce, but I have no field at all in the admin so far.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpic committed Oct 9, 2015
1 parent 6e4723c commit c80394a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions autocomplete_light/example_apps/basic/admin.py
Expand Up @@ -35,3 +35,5 @@
'form': ModelForm, 'inlines': [Inline]})

admin.site.register(model, ModelAdmin)

admin.site.register(MtmLeftModel)
Expand Up @@ -2,7 +2,7 @@

from .models import *

models = [OtoModel, FkModel, MtmModel, GfkModel]
models = [OtoModel, FkModel, MtmModel, GfkModel, MtmLeftModel]

try:
import genericm2m
Expand Down
32 changes: 32 additions & 0 deletions autocomplete_light/example_apps/basic/models.py
Expand Up @@ -114,3 +114,35 @@ class FullModel(models.Model):

def __str__(self):
return self.name


@python_2_unicode_compatible
class MtmLeftModel(models.Model):
name = models.CharField(max_length=128)
relation = models.ManyToManyField('MtmRightModel',
through='MtmMiddleModel')

noise = models.ForeignKey('FkModel', null=True, blank=True)

for_inline = models.ForeignKey('self', null=True, blank=True,
related_name='inline')

def __str__(self):
return self.name


class MtmMiddleModel(models.Model):
left = models.ForeignKey('MtmLeftModel', related_name='left_of')
right = models.ForeignKey('MtmRightModel', related_name='right_of')
for_inline = models.ForeignKey('self', null=True, blank=True,
related_name='reverse_for_inline')


@python_2_unicode_compatible
class MtmRightModel(models.Model):
name = models.CharField(max_length=128)
for_inline = models.ForeignKey('self', null=True, blank=True,
related_name='reverse_for_inline')

def __str__(self):
return self.name
Binary file modified test_project/db.sqlite
Binary file not shown.
Binary file removed test_project/dev.db
Binary file not shown.

0 comments on commit c80394a

Please sign in to comment.