TabularInline with collapse classes

440 views
Skip to first unread message

Donn

unread,
Aug 12, 2008, 10:40:15 AM8/12/08
to django...@googlegroups.com
Okay,
Got an admin change form with a 'toon' form above and many 'comments' below.
Is there some way to make the comments inline collapseable?

I have tried every combo of the fieldsets tuple, but I can't figure it out.

Also, in the fieldsets there's a key called "fields". Does one really have to
name each and every field in the model (again) in this dict?

Here's my basic styling of the admin:

class CommentsInline(admin.TabularInline):
model = Comment
class ToonAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title",)} #sluggify the title field
inlines = [CommentsInline] #Use the inline thing above.
ordering = ['pubdate']

Thx,
\d

Donn

unread,
Aug 13, 2008, 7:52:21 AM8/13/08
to django...@googlegroups.com
Perhaps someone can point me to an example?

\d

Karen Tracey

unread,
Aug 13, 2008, 9:23:49 AM8/13/08
to django...@googlegroups.com
On Wed, Aug 13, 2008 at 7:52 AM, Donn <donn....@gmail.com> wrote:

Perhaps someone can point me to an example?

http://code.djangoproject.com/ticket/494

requests this function.  It's not critical for 1.0 so has been pushed to post-1.0.  If it's critical for you feel free to develop a patch.  (The ticket already has a patch but it was developed for old admin so probably doesn't apply. You might use it as a starting point, though.)

Karen

Donn

unread,
Aug 13, 2008, 9:34:03 AM8/13/08
to django...@googlegroups.com
On Wednesday, 13 August 2008 15:23:49 Karen Tracey wrote:
> http://code.djangoproject.com/ticket/494
> requests this function.
Ah, fair enough, Thanks. I dunno if I have the brains to make patches, I can
barely lift the docs :)

\d

Reply all
Reply to author
Forward
0 new messages