Hi,

I'm trying to use this newforms-admin to make custom forms for my app/
project (I have a lot of inline stuff in my models, so it's supposed
to come handy). I've already managed to convert my models to newforms-
admin (it's not that hard since it's documented) and I'm currently
able to add/edit entries with inline items -- but only in /admin/ ..

I gave a look at newforms.models and I see this "InlineFormSet" class,
but I can't really understand how to use it, nor I can find docs on
this matter, the only thing I found (don't ask me how) is
http://code.djangoproject.com/ticket/6632 .. that explains the various
FormSets (including InlineFormSet - and yes, I realize that would be a
patch for the main trunk, but the classes are named in the same way as
in newforms-admin), so I do know the options I'm supposed to pass to
an inline form set; what I do not know is how can I create one! :\

So, given a very simple example (the classic "polls" app from the
django tutorial), is anyone able to show me how to set up a proper
ModelForm with "Choice" being an InlineFormSet of Poll?

I'm sorry if it sounds dumb, but I can't really figure it out on my
own, and I see (from the searches on the group) that other people had
my same problem (but I couldn't find an helpful thread, am I blind?)

I'll include models.py below:
### begin of polls/models.py
class Poll(models.Model):
    question = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

    def __unicode__(self):
        return self.question

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(max_length=200)
    votes = models.IntegerField()

    def __unicode__(self):
        return self.choice
### end of polls/models.py


Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to