Friday, January 30, 2015

Custom model field and custom widget

Hi,

I need to create a custom django model field, a varchar(10) field which has a calculated value set on save on the model using it and then never changed. This should happen automatically. This field should appear as hidden or read-only in forms and it would be nice to handle the render output if the field is accessed in templates. The calculated value generated on save must access the database and look into a seperate table to calculate its value, ie. I need to control the generation of the value it gets.

Any ideas or hints?

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/282086f4-31fc-47c7-9d6b-62fd8e05e556%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment