I could also see a use for this.  Also, it would be nice to specify
that at least one instance of the inline object be required.  With the
above example, when adding a Kingdom, at least one (or however many
specified) Phylums would be required.  A common use for this would be
a person model, with an inline address model, but you want every
person to have at least one address.

On Feb 2, 3:23 pm, "Rob Hudson" <[EMAIL PROTECTED]> wrote:
> > I agree this approach is a huge improvement over the current syntax,
> > but I wonder whether it can be expanded even more. Instead of
> > dictionaries, let's use objects:
>
> Woah... inline that is specified by objects that can be subclasses?
> I'll have to wrap my head around that one.
>
> Would it be possible to nest inlines?  This is one limitation we
> sometimes bump up against since our data model spans more than a few
> relationships sometimes, and it would be nice to have greater inline
> depth.
>
> For example, if you have:
>
>     class Kingdom(models.Model):
>         #
>         class Admin:
>             inlines = (
>                 StackedInline('Phylum')
>             )
>
>     class Phylum(models.Model):
>         kingdom = models.ForeignKey(Kingdom)
>         class Admin:
>             inlines = (
>                 StackedInline('Class')
>             )
>
>     class Class(models.Model): # ignore the reserved word :)
>         phylum = models.ForeignKey(Phylum)
>         class Admin:
>                 inlines = (
>                     StackedInline('Order')
>                 )
>     etc...
>
> Could that work and span all those relationships, following the
> relationships as it goes.
>
> -Rob


--~--~---------~--~----~------------~-------~--~----~
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