> And when I save form, got this error:
> Invalid value: 'region' should be a <class
> 'serp2.apps.common.models.Region'> instance, not a <type 'str'> Request
The hint is in the error message.
You must pass a Region object to the region parameter,
new_data['region'] contains only the id that the user selected from
the select list.
You can do this:
def save(self, new_data):
t = Town(
region = Region.objects.get(pk=new_data['region']),
[...]
)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---