Hi

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)?

thanks
jul

class Rating(models.Model):

    user = models.ForeignKey(User)
    restaurant = models.ForeignKey(Restaurant)
    rating = models.PositiveSmallIntegerField()


class AddRestaurantForm(ModelForm):

    rating = models.IntegerField()

    class Meta:
        model = Restaurant




--

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