diff options
author | Leif Johansson <leifj@sunet.se> | 2011-08-07 14:34:14 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-08-07 14:34:14 +0200 |
commit | 99a05864a9a9ff8ac1c68400f111ede67cf3fe28 (patch) | |
tree | 470f3c631d52a860ec5376c9993a61a1eaee2688 /coip/apps/userprofile | |
parent | 63ec9216a9d85c80499fef9e0d9682d09ffa2875 (diff) |
first take at minimal opensocial
Diffstat (limited to 'coip/apps/userprofile')
-rw-r--r-- | coip/apps/userprofile/models.py | 2 | ||||
-rw-r--r-- | coip/apps/userprofile/views.py | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/coip/apps/userprofile/models.py b/coip/apps/userprofile/models.py index b6c2234..40751fb 100644 --- a/coip/apps/userprofile/models.py +++ b/coip/apps/userprofile/models.py @@ -5,6 +5,7 @@ Created on Jul 5, 2010 ''' from django.db import models from django.contrib.auth.models import User +from coip.apps.name.models import Name class UserProfile(models.Model): user = models.ForeignKey(User,blank=True,null=True,related_name='profiles') @@ -15,6 +16,7 @@ class UserProfile(models.Model): identifier = models.CharField(max_length=1023,unique=True) timecreated = models.DateTimeField(auto_now_add=True) lastupdated = models.DateTimeField(auto_now=True) + home = models.ForeignKey(Name,blank=True,null=True,editable=False) def __unicode__(self): return "%s [%s] - %s" % (self.identifier,self.user.username,self.display_name) diff --git a/coip/apps/userprofile/views.py b/coip/apps/userprofile/views.py index 3ca4416..5829fc3 100644 --- a/coip/apps/userprofile/views.py +++ b/coip/apps/userprofile/views.py @@ -48,6 +48,7 @@ def home(request): profile = user_profile(request) home = lookup('user:'+request.user.username,autocreate=True) home.short = "%s (%s)" % (profile.display_name,profile.identifier) + profile.home = home home.save() add_member(home,profile.user,hidden=True) home.setacl(home,"rwlda") #don't allow users to delete or reset acls on their home, nor invite members - that would be confusing as hell |