On Nov 9, 7:49 am, NMarcu <marcu.nico...@gmail.com> wrote:
> Hello all,
>
>    I have a list of all users. My head table is made with the fields
> from User class. So look like this:
>
> username           first name             last name
> superuser status
>
> I want to make this head table editable. How can I change the caption
> of the field, not the name of it. By ex: is_superuser field is build
> like this:
>
> is_superuser = models.BooleanField(_('superuser status'),
> default=False, help_text=_("Designates that this user has all
> permissions without explicitly assigning them."))
>
> In my table is list superuser status not is_superuser, this is good.
> How can I change: "superuser status" in something else from a view.

To make something this dynamic, you will need a model for your label,
with some way to key it to the column you want to use it for - I can't
think of a clean way to change the verbose name of the classes
dynamically as the objects are instantiated per request.  A simple, if
somewhat brittle way to do it, would be to use the __name__ of the
model in question and use that as a key to look up the label to use in
your form.

-Preston

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

Reply via email to