I think the problem here is with ModelForms. Where would you define these properties for ModelForms? Putting them in your Model classes doesn't make sense because it violates loose coupling between models and forms/templates. It's already quite peculiar that Model fields can have a blank=True attribute.
If you haven't already, look into django-crispy-forms. It gives you much more granular control over your forms while maintaining loose coupling and OO-syntax.
On Thursday, January 19, 2017 at 5:11:47 AM UTC+1, Norberto Bensa wrote:
-- If you haven't already, look into django-crispy-forms. It gives you much more granular control over your forms while maintaining loose coupling and OO-syntax.
On Thursday, January 19, 2017 at 5:11:47 AM UTC+1, Norberto Bensa wrote:
Hello,
I usually need to make form fields readonly or autofocus (the app I'm
developing right now has a lot of these).
While I can do it in the form or a custom field, I'm wondering why
there's no support for these attributes out-of-the-box (btw, there's
support for disabled).
TIA,
Norberto
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8ca2a8a4-a8b2-48ed-b80c-e0931db5b93e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment