On 6/09/2011 5:46am, Mario8k wrote:
Hello,
Does anyone knows some solution (reusable app, snippet or any idea) to
model an authorization workflow of data?
That is... supose that a user have restricted some model field, ie,
cannot edit directly this field. And now supose that he could request
to change that field, seeing the real content and editing it, and
then "save" model. Saving model, doesn't commit the transaction, until
another user (an administrator) authorize the change (the actual
commit).
Any idea?
I would consider keeping all the edits in the same record. Then you
could have 'approved' and 'edited' as two versions of the field. For
example, the lower-privileged user edits a copy of 'approved' in
'edited' and save() just saves it. When the admin eventually approves
it, the 'edited' field gets copied to the real field.
mike
A trivial idea is to have another request model replicating the
structure (or only the restricted fields) of the original one. So, the
user who need to change the restricted fields completes this new
model.
For example:
class Foo(model.Models):
name = models.CharField()
class FooRequest(model.Models):
name = models.CharField()
Then we need an action to copy and replace data to Foo from
FooRequest.
The problem with this solution, is that i need it for a lot of models,
not just one.
Thanks for your time,
Regards,
Mario.
--
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.