On 2011-05-14, at 6:08 PM, br wrote:
> However, come interface tweaking time (now), we decided we want to
> display a page with a check box "Auto Cycle?" instead of "click-
> through", so I basically need to invert the actual value with respect
> to this interface .
> What is the easiest way to implement this?
You can access the field and initial data inside the form init and do anything
you want there. Which depends upon how you are calling your Model form. If you
are passing through an instance, for example, you could tweak it:
class MyForm(ModelForm):
def __init__(self, *args, **kw):
kw['instance'].click_through = True
super(MyForm, self).__init__()
--
Andy McKay
[email protected]
twitter: @andymckay
--
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.