@@ -72,9 +72,9 @@ def get_name(self):
72
72
return l
73
73
return f + " " + l
74
74
75
- def get_attributes (self , public = False ):
75
+ def get_attributes (self , public = False , area = "FOAF" ):
76
76
attributes = {}
77
- for a in UserAttribute .objects .filter (user = self , public = public ):
77
+ for a in UserAttribute .objects .filter (user = self , public = public , foaf_name__not = None ):
78
78
attributes [a .attribute .name ] = a .value
79
79
return attributes
80
80
@@ -116,14 +116,27 @@ def createDJIDUser(sender, instance, **kwargs):
116
116
#Identities can have attributes. These items represent one possible attribute.
117
117
class IdentityAttribute (models .Model ):
118
118
name = models .CharField ("Name" , max_length = 128 , help_text = "Internal name of the attribute." , primary_key = True )
119
+
120
+ ax_name = models .TextField (blank = True , null = True )
121
+ foaf_name = models .TextField (blank = True , null = True )
122
+ namespace = models .TextField (blank = True , null = True )
123
+
124
+ openid_attribute = models .BooleanField (default = False )
125
+ foaf_attribute = models .BooleanField (default = False )
126
+
119
127
title = models .CharField ("Title" , max_length = 128 , help_text = "Title of the attribute, as displayed to the user" )
120
128
description = models .TextField ("Description" , blank = True , help_text = "Longer description of the attribute, as displayed to the user" )
129
+ protocol = models .TextField (null = True , blank = True )
121
130
regex = models .CharField ("Validation regex" , max_length = 128 , blank = True , help_text = "Regex the value of this field is validated upon on updates" )
122
131
123
132
def __str__ (self ):
124
133
return self .title
125
134
126
135
136
+
137
+
138
+
139
+
127
140
#This maps an attribute to a user, including a value, obviously
128
141
class UserAttribute (models .Model ):
129
142
user = models .ForeignKey (DjangoidUser , help_text = "DjangoidUser this attribute value belongs to" )
0 commit comments