Re: Problem with custom forms and related objects

2007-01-02 Thread JMCameron
Thanks Justin! I just figured this out myself. I'll include the updated RoomForm definition below since I've cleaned it up a bit and made a small fix to the save function: -- from django.db.models.related import RelatedObjec

Re: Problem with custom forms and related objects

2007-01-02 Thread jfagnani
JMCameron wrote: Somehow, the AddManipulator does a bit of magic to make {% for the_chair in form.chair %} work in the template. When it works, as far as I can tell, in first pass, the_chair has a dictionary of all the chair.0.* objects, second pass has a dictionary of all the chair.1.* objec

Re: Problem with custom forms and related objects

2006-12-31 Thread Waylan Limberg
On 12/30/06, JMCameron <[EMAIL PROTECTED]> wrote: Thanks ElGranAzul, my django code is up to date (via svn), so 'oldforms' is equivalent to 'forms' (the __init__.py files are the same). So using 'from django import oldforms as forms' may be better form (no pun intended!), but will not fix th

Re: Problem with custom forms and related objects

2006-12-30 Thread JMCameron
Thanks ElGranAzul, my django code is up to date (via svn), so 'oldforms' is equivalent to 'forms' (the __init__.py files are the same). So using 'from django import oldforms as forms' may be better form (no pun intended!), but will not fix the problem I'm trying to figure out. Both RoomForm a

Re: Problem with custom forms and related objects

2006-12-30 Thread ElGranAzul
Are you using svn version?, if the answer is yes, you should read http://www.djangoproject.com/documentation/newforms/. With the upcoming of newforms, there is a migration plan for old forms (the one you're using), so, in views.py line 4, "from django import forms" should be "from django import

Problem with custom forms and related objects

2006-12-29 Thread JMCameron
I'm having a problem with custom forms and models with related objects. I've created a simplified test case that illustrates the problem. Here is the model file (a room contains several chairs): -- model.py - class Room(models.Model): name = models.CharField(ma