Re: getting information from a many to many model from user
That would work nicely if I had done my own user management app but I lazily used Userena. I think I need to override a function of their profile form so it only displays fields if the superuser or a designated boolean in same said profile is set to true:)
Do you know how I would over ride a class function ?
On Thursday, 6 June 2013 13:02:02 UTC, Daniel Roseman wrote:
-- On Thursday, 6 June 2013 13:02:02 UTC, Daniel Roseman wrote:
On Thursday, 6 June 2013 11:00:40 UTC+1, tony gair wrote:I use the Userena app to manage my users but I want the superuser to choose the organisation for them so they cannot wonder around other organisations information.I can either create a foreign key in their profile to point to the organisation but then I expect they can change it, which would not be acceptable.I could create a many to many set of models (as per the documentation) but then I need to discover the organisation they are part of, every time a form is entered into, in which case I would need a function to discover the organisation id from the querying the user object in my group model.My favourite would probably be to have unmodifiable fields (by them) but which the superuser can alter. Anyone know how I would do this?Users can only alter fields if you write code that allows them to do so. If you don't want them to alter a particular field in their profile, just don't include that field on the form (or specifically exclude it).--DR.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home