Custom model field and custom widget

18 views
Skip to first unread message

Thomas Weholt

unread,
Jan 30, 2015, 9:03:41 AM1/30/15
to django...@googlegroups.com
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?

Collin Anderson

unread,
Feb 19, 2015, 1:04:28 PM2/19/15
to django...@googlegroups.com
Hi,

Sorry for the late reply. Check out editable=False if you haven't.

Collin
Reply all
Reply to author
Forward
0 new messages