Is there a way to get the value of the 'instance' keyword argument
from within a Form sub-classed by ModelForm? For example:
class CS_SKU(models.Model):
colors = models.ManyToManyField(Color, blank=True, null=True)
color_field = forms.ModelMultipleChoiceField(queryset=colors)
class Form_SKU(ModelForm):
"""
The form for updating SKUs.
"""
selected = self.instance.colors
def some_test_view():
Form_SKU(instance=<SOMECOLOR>)
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---