On 6/9/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
>
> On 6/8/07, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> > I'm most of the way there. Basically just template stuff and a little
> > bit of ModelAdmin code is left. I got stuck a few times keeping this
> > stuff usable outside the admin, and at multiple levels. I think it was
> > worth the effort, but time will tell. Expect to see a working version
> > checked in next week. Maybe sooner. And huzzah! core=True is no longer
> > necessary.
>
> This is great news. Looking forward to it!

I just checked in a bunch of changes.
http://code.djangoproject.com/changeset/5473

The templates still need some work, ok... a lot of work. I need to
write some more tests, and I'm going to rework some of the internals,
but things are pretty much functional.

Feel free to start filing bugs and asking questions, but please ask
them in a new thread. And to answer many people's first question, no,
you cannot have inlines inside of inlines. If you want that, you're on
your own, and good luck ;) The second question, no, inline file
uploads don't work right now, but I plan on making that happen at some
point.

Joseph

------------------------------------------------
from django.db import models
from django.contrib.admin import site, ModelAdmin, StackedInline, TabularInline

class Poll(models.Model):
    question = models.CharField(maxlength=255)

    def __str__(self):
        return self.question

class Choice(models.Model):
    poll = models.ForeignKey(Poll)

    choice = models.CharField(maxlength=255)
    votes = models.IntegerField()

    def __str__(self):
        return self.choice

class PollAdmin(ModelAdmin):
    inlines = [TabularInline(Choice, extra=2)]

class ChoiceAdmin(ModelAdmin):
    list_display = ['choice', 'poll', 'votes']

site.register(Poll, PollAdmin)
site.register(Choice, ChoiceAdmin)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to