Greetings,
class SocialNodeSubscription(model.Model):
starting_date=model.DateProperty(auto_now=True)
user = model.KeyProperty()
def __init__(self, *args, **kwargs):
permissions=["post","read","reply","admin"]
for i in permissions:
exec "can_%s=model.BooleanProperty(default=True)" % i
super(SocialNodeSubscription, self).__init__(*args, **kwargs)
this is my model.
What i'm trying to do is to define a list of properties for my permissions
called "can_post", "can_read" and so on.
My problem is that it simply does nothing. When i try to put a new instance
in the datastore, it gives no problem but it simply ignores those fields.
Here is another version that behaves the same
def __init__(self, *args, **kwargs):
permissions=["post","read","reply","admin"]
for i in permissions:
self_properties['can_'+i]=model.BooleanProperty(default=True)
super(SocialNodeSubscription, self).__init__(*args, **kwargs)
How can i fix this so that the system can use those properties?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/c9EdV1yU1fMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.