List Info

Thread: non-editable model elements and generic updates




non-editable model elements and generic updates
country flaguser name
United States
2007-05-31 16:07:30
What is the best practice for handling this?

Let's say I have a form with 3 fields:
name, b-day, status

I want a form that will allow the user to edit
"name" and "b-day",
then keep "status" whatever it was before the
edit. Should I send this
through as a hidden field?

Of course, I'm talking about a much larger model here, but
simplifying
for the sake of er... simplicity. Actually the model has
about 15
elements and the user will be editing about 10.

The problem is this: if all 15 fields are filled, and some
are set to
"editable=False", the form goes through fine, but
all the fields not
in the form are set to null, or otherwise wiped out. How can
I get
around this? Is my only option to pass all that info through
as hidden
fields?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: non-editable model elements and generic updates
country flaguser name
United States
2007-05-31 16:17:52
Just ignore me. I like to overlook obvious bits then wonder
why it
isn't working. I was using "editable=False" in
several of the fields I
wanted to hide, but missed one. So the
"editable=False" solution *is*
the fix I was looking for, I just gooned it up by missing a
field. 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )