It seems like I'm missing something, but here's what I'm trying to do:
In creating a Form object, I'm setting size limit validation
(max_length). I'd like to recover the value for that from the
corresponding Model's Field's max_length. So basically I want a symbol
lookup that will inspect in the options of a field I have defined for
a model, without having an instance of the model, just it's type.
This is to avoid the 2 having to share a common separately defined
constant, or just using an integer that I have to coordinate in both
places, or in place of always using auto forms.
eg
class MyModel(Model):
myfield = CharField(max_length=128)
------
class MyForm(Form):
myfield = CharField(max_length=**GET.FROM.MODEL**)
I assume that by using the Meta: model = logic in Form for auto form,
that this is being done, but it wasn't obvious to me how.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---