specialunderwear/django-easymode — Issue #3: Incorrect LinkInline behaviour
Author: nnseva
Created: 2011-11-09 13:16:18+00:00
State: open

For some reason, the LinkInline doesn't show inline objects except the first one.

I've created a very simple example with two models:

```python
from django.db import models

# Create your models here.
class Top(models.Model):
text = models.TextField()
class Bottom(models.Model):
top = models.ForeignKey(Top)
text = models.TextField()
```

and created a simple admin for them:

```python
from django.contrib import admin
from django.conf.urls.defaults import *

from easymode.tree.admin.abstract import LinkInline, LinkedItemAdmin
from easymode.tree.admin.relation import InvisibleModelAdmin

from testone import models

class BottomInline(LinkInline):
model = models.Bottom
parent_link = 'top'

class BottomAdmin(InvisibleModelAdmin):
model = models.Bottom
parent_link = 'top'

admin.site.register(models.Bottom,BottomAdmin)

class TopAdmin(LinkedItemAdmin):
inlines = [
BottomInline,
]

admin.site.register(models.Top,TopAdmin)

'''
class BottomInline(admin.TabularInline):
model = models.Bottom

class TopAdmin(admin.ModelAdmin):
inlines = [
BottomInline,
]

admin.site.register(models.Top,TopAdmin)
'''
```

The first (uncommented) portion of the admin is working with easymode, while the second one (commented out) is a standard django admin code.

I am filling in one Top object and several Bottom objects linked to the Top one. When I am looking to the standard admin, I see several filled objects:
https://docs.google.com/open?id=0B6V0N4fDeXFPNjJjZGExMDMtNjk5Yi00NzZiLWE2MjctZDVjNjE5OWRlNDM4

When I am looking to the easymode-powered admin, I see the only one Bottom object filled, but several object lines with links (links are working):
https://docs.google.com/open?id=0B6V0N4fDeXFPYzM5MGZlMGItNjExYi00MGRhLTkwMjUtYjEwZDViZGEwNTU5