Hi,

I don't actually have a problem but rather a need for a suggestion. I
am building a web application and in order to demo the site on one
database I have a need to secure the data for each user. I have a
field in each model that is a foreign key to a unique field on the
User model. The tricky part is that it's becoming a lot of maintenance
to check in each view if the record was created by the user or not. I
wrote a normal middleware that adds the users unique site to the
request. This helps with having the user site in each view but I was
wondering how I could get the user site into a model so that each time
a user calls a model or saves a model it validates that it was created
by that user.   Ideally I would like to get the users site into a
ModelManager and limit the queryset there and have the users site
available in the save method of a model. I do not want to add the
users site to the session as it's easy to manipulate a session
variable.

Is there any form of middleware for models so that you can pass the
request object to it?

Any advice will be highly appreciated.

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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