I meant rating = forms.IntegerField()

On Nov 13, 11:16 am, Hector Garcia <hecto...@gmail.com> wrote:
> You have a rating field in your model, I don't know if it is
> intentionally but then in your ModelForm, if you specify an extra
> field also named 'rating' then you are overriding the one in the
> model, I think. Also, such extra field in the form, shouldn't it be
> form.IntegerField instead of model.IntegerField?
>
> Hector Garcia - Web developer, musicianhttp://nomadblue.com/
>
> On Fri, Nov 13, 2009 at 5:35 AM, Andy Mckay <a...@clearwind.ca> wrote:
> > On 09-11-12 2:33 PM, jul wrote:
> >> I've got the Rating model and the AddRestaurantForm shown below. In
> >> order to add a rating when submitting a new restaurant, I added an
> >> extra field to AddRestaurantForm. Can I do that? If I can, how can I
> >> save separately the Restaurant instance and the rating instance (I'll
> >> get the user from the context)?
>
> > Sure that works just fine.
>
> > When you save the form, you'll save the restaurant instance. You can
> > then get the rating from the forms.cleaned_data and save that however
> > you'd like.
> > --
> >   Andy McKay
> >   @clearwind
> >   Training:http://clearwind.ca/training/
> >   Zen:http://djangozen.com
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to