Re: How to pass object *and* subobjects to FormWrapper?
well, I might be wrong here, but the custom manipulator doesn´t have any data - it´s there for handling the custom form. to prefill the form you have to *get* the data and therefore you have to use a ChangeManipulator. patrick Am 20.09.2006 um 09:54 schrieb Sean Schertell: > > Thank Patrick but I'm using a *custom* manipulator so my manipulator > doesn't have those attributes. > > Sean > > > On Sep 20, 2006, at 4:39 PM, patrickk wrote: > >> >> not sure if this will solve the problem, but according to the >> documentation you should use >> 1. manipulator = Place.ChangeManipulator(place_id) >> 2. place = manipulator.original_object >> 3. new_data = manipulator.flatten_data() >> >> nr. 3 has been changed in the docs recently: >> see http://www.djangoproject.com/documentation/forms/#using-the- >> changemanipulator >> >> patrick >> >> >> Am 20.09.2006 um 08:03 schrieb Sean Schertell: >> >>> >>> Using a custom manipulator, I'm trying to populate my form with >>> existing data. But I can't get the data from the FK tables to show >>> up. >>> >>> Here's a simplified example: >>> >>> Group >>> name >>> >>> Member >>> first_name >>> last_name >>> >>> >>> So let's say a Group can only have up to 6 members. And I have a >>> form >>> that lets you add a group and up to 6 members all in one go. My add >>> form works fine. And my edit form works to the point of populating >>> the group -- but not the members. >>> >>> Here's basically what I'm doing to get the data into the form: >>> >>> In my custom GroupManipulator, I fetch the data like this: >>> self.original = Group.objects.get(id=group_id) >>> >>> Then in my edit_group view, I do this: >>> new_data = manipulator.original.__dict__ >>> >>> And pass new_data to a FormWrapper as normal. >>> >>> Like I said, this all works perfectly except that the members of my >>> edit form are blank. >>> >>> How can I pull in subobjects along with the parent object and >>> pass it >>> to the FormWrapper? >>> >> >> >>> >> >> > > DataFly.Net > Complete Web Services > http://www.datafly.net > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to pass object *and* subobjects to FormWrapper?
Thank Patrick but I'm using a *custom* manipulator so my manipulator doesn't have those attributes. Sean On Sep 20, 2006, at 4:39 PM, patrickk wrote: > > not sure if this will solve the problem, but according to the > documentation you should use > 1. manipulator = Place.ChangeManipulator(place_id) > 2. place = manipulator.original_object > 3. new_data = manipulator.flatten_data() > > nr. 3 has been changed in the docs recently: > see http://www.djangoproject.com/documentation/forms/#using-the- > changemanipulator > > patrick > > > Am 20.09.2006 um 08:03 schrieb Sean Schertell: > >> >> Using a custom manipulator, I'm trying to populate my form with >> existing data. But I can't get the data from the FK tables to show >> up. >> >> Here's a simplified example: >> >> Group >> name >> >> Member >> first_name >> last_name >> >> >> So let's say a Group can only have up to 6 members. And I have a form >> that lets you add a group and up to 6 members all in one go. My add >> form works fine. And my edit form works to the point of populating >> the group -- but not the members. >> >> Here's basically what I'm doing to get the data into the form: >> >> In my custom GroupManipulator, I fetch the data like this: >> self.original = Group.objects.get(id=group_id) >> >> Then in my edit_group view, I do this: >> new_data = manipulator.original.__dict__ >> >> And pass new_data to a FormWrapper as normal. >> >> Like I said, this all works perfectly except that the members of my >> edit form are blank. >> >> How can I pull in subobjects along with the parent object and pass it >> to the FormWrapper? >> >>> > > > > > > DataFly.Net Complete Web Services http://www.datafly.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to pass object *and* subobjects to FormWrapper?
not sure if this will solve the problem, but according to the documentation you should use 1. manipulator = Place.ChangeManipulator(place_id) 2. place = manipulator.original_object 3. new_data = manipulator.flatten_data() nr. 3 has been changed in the docs recently: see http://www.djangoproject.com/documentation/forms/#using-the- changemanipulator patrick Am 20.09.2006 um 08:03 schrieb Sean Schertell: > > Using a custom manipulator, I'm trying to populate my form with > existing data. But I can't get the data from the FK tables to show up. > > Here's a simplified example: > > Group > name > > Member > first_name > last_name > > > So let's say a Group can only have up to 6 members. And I have a form > that lets you add a group and up to 6 members all in one go. My add > form works fine. And my edit form works to the point of populating > the group -- but not the members. > > Here's basically what I'm doing to get the data into the form: > > In my custom GroupManipulator, I fetch the data like this: > self.original = Group.objects.get(id=group_id) > > Then in my edit_group view, I do this: > new_data = manipulator.original.__dict__ > > And pass new_data to a FormWrapper as normal. > > Like I said, this all works perfectly except that the members of my > edit form are blank. > > How can I pull in subobjects along with the parent object and pass it > to the FormWrapper? > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to pass object *and* subobjects to FormWrapper?
Using a custom manipulator, I'm trying to populate my form with existing data. But I can't get the data from the FK tables to show up. Here's a simplified example: Group name Member first_name last_name So let's say a Group can only have up to 6 members. And I have a form that lets you add a group and up to 6 members all in one go. My add form works fine. And my edit form works to the point of populating the group -- but not the members. Here's basically what I'm doing to get the data into the form: In my custom GroupManipulator, I fetch the data like this: self.original = Group.objects.get(id=group_id) Then in my edit_group view, I do this: new_data = manipulator.original.__dict__ And pass new_data to a FormWrapper as normal. Like I said, this all works perfectly except that the members of my edit form are blank. How can I pull in subobjects along with the parent object and pass it to the FormWrapper? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---