From 99a05864a9a9ff8ac1c68400f111ede67cf3fe28 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Sun, 7 Aug 2011 14:34:14 +0200 Subject: first take at minimal opensocial --- coip/apps/userprofile/models.py | 2 ++ coip/apps/userprofile/views.py | 1 + 2 files changed, 3 insertions(+) (limited to 'coip/apps/userprofile') 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 -- cgit v1.1