Can anyone suggest the best way to implement a model where there are many different types of users, all of which have access to different fields in the same database item?
We are a pair of Django newbies who are trying to port an in-house Content Management System across from PHP. The CMS sits behind a web site that publishes information about movies. We have a fairly complex editorial process involving about 5 different writers/editors. Each writer needs to be able to see the other writers' fields, but just be able to edit the data in their own. Our problem is that we can't figure out the best way to restrict user access to the particular fields they should be working with. Our first attempt to implement this involved setting up separate models for each user and then creating one-to-one relationships between them. We figured this would let us use the built-in Admin's permissions to determine who can edit what. It would also keep our business logic in the model, which is the best place for it. So far we have not had much success with this approach, partly because we can't find any good documentation for one-to-one relationships. We haven't even been able to get a simplified test implementation working this way (see my colleague's post at http://groups.google.com/group/django-users/browse_thread/thread/a788ec21d57f19a0), and we're really not sure if it's worth persevering with this approach, as the complete business model is reasonably complex, with one-to-many relationships as well as the one-to-ones. Has anyone successfully built something like this? Are we barking up the wrong tree? Our fallback approach is to simplify our model and deal with the different levels of user access at the view level, by adding a switch to views.py that uses a different template for each user group. This is pretty inelegant, but at least we know we can get it working. Or are there other approaches we have missed? --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---