not exactly, it seems that originally form_for_instance and
form_for_object had different functions.
I have a class
class Blog(models.Model):
title = models.CharField('Title',max_length=200)
text = models.TextField('Text',max_length=2048)
date = models.DateTimeField('Last Modified')
def __unicode__(self):
return '%s' % (self.title)
and I wanted to have something along these lines but don't know how to
convert to the new convention
BlogForm = forms.form_for_model(Blog, fields=('title','text')
bf = BlogForm()
p = get_object_or_404(Person,pk=pID)
if request.method == 'POST':
if request.POST['submit'] == 'add':
bf = BlogForm(request.POST.copy())
SaveForm = forms.form_for_model(Blog)
...
On Sep 10, 10:42 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Sep 10, 9:56 am, David <[EMAIL PROTECTED]> wrote:
>
> > Thanks, are they also any example of the case of form_for_model (as I
> > am assuming the above is only with respect to form_for_instance)
>
> > Thx.
> > D.
>
> But that's just what you had already:
>
> > > > I've tried simply f = MyForm(request.POST.copy()) where MyForm is
> > > > previously defined as a class with model=Person, but then django
> > > > thinks its a new entry rather than an update
>
> Isn't that what you want?
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---