Re: Form validation using model data?

2012-07-31 Thread Kurtis Mullins
ahh okay, then I simply create two model forms. class CreateURLForm(ModelForm): class Meta: fields = ('url', 'name') # This will restrict the user to only modifying this data model = URLModel # Or whatever your model is called class UpdateURLForm(ModelForm): class Meta:

Re: Form validation using model data?

2012-07-30 Thread Paul
That would be an option as well indeed. In fact i have 1 (base)-form for the model that i subclass for create, read and update operations. The difference is that create and update have a submit button, read doesn't, and in the read view, the fields are read-only. The website becomes authenticat

Re: Form validation using model data?

2012-07-29 Thread Kurtis Mullins
Just to get some more information about the problem; Do you allow your users to initially insert the Name+URL? When does this become "authenticated"? Maybe you could have two forms. One that allows users to add new Name+URL Objects (not sure what your object/Model is called) and another to allow t

Form validation using model data?

2012-07-29 Thread Paul
I have a model for Websites that has 3 fields: name, url and authenticated. With a form both the name and url can be changed, but when the website is authenticated i don't want to allow that the url changes. I'm thinking about making the url (form) field readonly but in html the field becomes s