Re: Authorization workflow model

2011-09-07 Thread Mario8k


On 6 sep, 06:31, Julien Castets  wrote:
> Hi,
>
> I faced to the same problem than you a few weeks ago, and I found this
> :https://github.com/dominno/django-moderation#readme
> It seems to be what you're searching.
>

This reusable app seems to work for me. I will try it.
Thanks.

> Julien Castets
> +33 (0)6.85.20.10.03

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.



Re: Authorization workflow model

2011-09-07 Thread Mario8k


On 6 sep, 00:55, Mike Dewhirst  wrote:
> 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.
>

Thanks mike.
Yes i'm consider your suggestion. But i prefer to have the edits in
other model, because the original model remains a bit 'clean'.
I will evaluate your proposal too.

> 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.



Re: Authorization workflow model

2011-09-07 Thread Mario8k


On 5 sep, 17:27, Shawn Milochik  wrote:
> You could use a model with three fields:
>     A generic foreign key to the instance to be modified.
>     A char field containing the fieldname on that instance.
>     The new value.
>
> Of course you'd need another field to store the user (assuming the
> person making the authorization will base their decision on who's
> making the request). Also, it'll get a little more complicated if you
> want to store values for different field types (boolean vs. string,
> for example), and maybe a boolean or a datetime field to indicate when
> the request was accepted/denied. Then you can store a field indicating
> whether it was approved or declined...
>
> So, the basics are at the top. Then you'll have to implement as much
> of the rest as you'll need.

Thanks for your answer. I will try your solution. Sounds good!

-- 
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.



Re: Authorization workflow model

2011-09-06 Thread Julien Castets
Hi,

I faced to the same problem than you a few weeks ago, and I found this
: https://github.com/dominno/django-moderation#readme
It seems to be what you're searching.



On Tue, Sep 6, 2011 at 5:55 AM, Mike Dewhirst  wrote:
> 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.
>
>



-- 
Julien Castets
+33 (0)6.85.20.10.03

-- 
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.



Re: Authorization workflow model

2011-09-05 Thread Mike Dewhirst

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.



Re: Authorization workflow model

2011-09-05 Thread Shawn Milochik
You could use a model with three fields:
A generic foreign key to the instance to be modified.
A char field containing the fieldname on that instance.
The new value.

Of course you'd need another field to store the user (assuming the
person making the authorization will base their decision on who's
making the request). Also, it'll get a little more complicated if you
want to store values for different field types (boolean vs. string,
for example), and maybe a boolean or a datetime field to indicate when
the request was accepted/denied. Then you can store a field indicating
whether it was approved or declined...

So, the basics are at the top. Then you'll have to implement as much
of the rest as you'll need.

-- 
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.



Authorization workflow model

2011-09-05 Thread Mario8k
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?

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.