Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 June 12, 2010 04:46:24

W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Controlling access to objects


Hi guys,
I don't know whether the built-in permissions system would be
appropriate here, but I want to control access to objects in one of my
models, based on profile fields, like gender, age, etc.

I planned to create a model "MyModelPermissions" like so:
class MyModelPermissions(models.Model):
mymodel = models.OneToOneField(MyModel)
gender = models.CharField(choices=)
....

But that doesn't seem very efficient. Any ideas on how best to do this?

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 12, 2010 14:35:52

Dan H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Controlling access to objects


This article might help you out:http://djangoadvent.com/1.2/object-permissions/Cheers,

Dan Harris
dih0...@gmail.com

On Jun 11, 11:46 pm, Wiiboy <jordon...@gmail.com> wrote:
> Hi guys,
> I don't know whether the built-in permissions system would be
> appropriate here, but I want to control access to objects in one of my
> models, based on profile fields, like gender, age, etc.
>
> I planned to create a model "MyModelPermissions" like so:
> class MyModelPermissions(models.Model):
>     mymodel = models.OneToOneField(MyModel)
>     gender = models.CharField(choices=)
>     ....
>
> But that doesn't seem very efficient. Any ideas on how best to do this?

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 12, 2010 17:00:42

W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Controlling access to objects


Thanks Dan.

I also found this:http://goo.gl/l2IW--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 20th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support