Re: Custom model field and custom widget

2015-02-19 Thread Collin Anderson
Hi,

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

Collin

On Friday, January 30, 2015 at 9:03:41 AM UTC-5, Thomas Weholt wrote:
>
> 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+unsubscr...@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/2195b874-bab4-4d0c-b13e-a9a144d1348b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Custom model field and custom widget

2015-01-30 Thread Thomas Weholt
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+unsubscr...@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.