Merge lp:~dholbach/loco-team-portal/profile into lp:loco-team-portal

Proposed by Daniel Holbach on 2010-08-26
Status: Merged
Approved by: Michael Hall on 2010-08-28
Approved revision: 261
Merged at revision: 266
Proposed branch: lp:~dholbach/loco-team-portal/profile
Merge into: lp:loco-team-portal
Diff against target: 1539 lines (+1182/-47) 23 files modified
To merge this branch: bzr merge lp:~dholbach/loco-team-portal/profile
Reviewer Review Type Date Requested Status
Michael Hall 2010-08-26 Approve on 2010-08-28
Review via email: mp+33792@code.launchpad.net

This proposal supersedes a proposal from 2010-08-24.

Description of the Change

I realise that this proposal is probably not quite there yet, but I need all the testing and all the eyeballs we have.

To post a comment you must log in.
Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

Open questions:
 - when do we update timezones (for somebody who moved to another country)
 - when do we get a list of all team members, so admin/owner can pick the loco contacts in the team

Answers and merge proposals into this branch are much appreciated. :-)

Chris Johnston (cjohnston) wrote : Posted in a previous version of this proposal

I mentioned it on IRC one day, and I'll ask here also. Why do we need to pull a users TZ?

Use case: We pull my TZ. It's -4. I am over in Germany, and while I'm there I decide to go to an event with Daniel. I go to LD, register to attend the event, and it shows me the time in a -4 TZ. What good will that do me? I now have to convert the time from my local TZ to the correct TZ in Germany.

The event time should be based upon the TZ the the event is located in (the venue's location) and not upon the TZ of the user. There could possibly be two entries, the TZ in which the event is located and the users home TZ, but that just seems to be adding extra things that don't need to be there. I may be way off with my thinking and would enjoy seeing more feedback, but this is how I understand the way the new system is going to work, and I dont think it's the best way for it to work.

Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

> I mentioned it on IRC one day, and I'll ask here also. Why do we need to pull
> a users TZ?

That's a question that Michael can answer best. How about the rest of the merge proposal?

Chris Johnston (cjohnston) wrote : Posted in a previous version of this proposal

Questions:
 - After selecting team contacts, they don't display on the team details page.
 - Can we remove LP team owner and LP team admins as they may not reflect what is accurate.

Dave Walker (davewalker) wrote : Posted in a previous version of this proposal

> Open questions:
> - when do we update timezones (for somebody who moved to another country)

It's my understanding that the profile is generated at login time. We could have "on login", do checks..

Or cronjob based.. At the moment, that wouldn't be intensive as there aren't that many authenticated users, but as LD gets more popular this could be a real bottleneck.

> - when do we get a list of all team members, so admin/owner can pick the loco
> contacts in the team
>

Do we *want* a list of all members, or stick to generating profile on login?

Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

> - After selecting team contacts, they don't display on the team details page.

That's a bug.

> - Can we remove LP team owner and LP team admins as they may not reflect what
> is accurate.

Why not accurate? We never say that LP team owner and LP team admins are LoCo contacts.

Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

> Or cronjob based.. At the moment, that wouldn't be intensive as there aren't
> that many authenticated users, but as LD gets more popular this could be a
> real bottleneck.

Not only on login, but also when a userprofile is created (admin/owners through lpupdate management command).

> Do we *want* a list of all members, or stick to generating profile on login?

The problem we have right now is that loco contacts can only be chosen from the list of existing profiles (logged in people + lp admins + lp owner).

Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

> > - After selecting team contacts, they don't display on the team details
> page.
>
> That's a bug.

Fixed.

Michael Hall (mhall119) wrote :

I'm going to approve and merge this so we can start building new features off of it.

review: Approve

Preview Diff

1=== modified file 'loco_directory/common/launchpad.py'
2--- loco_directory/common/launchpad.py 2010-08-20 13:05:47 +0000
3+++ loco_directory/common/launchpad.py 2010-08-26 14:45:53 +0000
4@@ -50,9 +50,9 @@
5
6 def is_admin_or_owner(username, team):
7 # check just using the LD data
8- if username == team.owner:
9+ if username == team.owner_profile.user.username:
10 return True
11- if team.admins.filter(lpid=username):
12+ if team.admin_profiles.filter(user__username=username):
13 return True
14 if is_debug_user(username):
15 return True
16@@ -80,3 +80,19 @@
17 except HTTPError:
18 # 404 or some other issue that means we should default to False
19 return "https://edge.launchpad.net/api/beta/ubuntu/mugshot"
20+
21+def get_user_timezone(username, lp=None):
22+ timezone = 'UTC'
23+ if username is None:
24+ return timezone
25+
26+ if not lp:
27+ lp = lp_login()
28+ if not lp:
29+ return timezone
30+ try:
31+ lp_user = lp.people[username]
32+ timezone = lp_user.timezone
33+ except:
34+ pass
35+ return timezone
36
37=== modified file 'loco_directory/events/forms.py'
38--- loco_directory/events/forms.py 2010-08-02 14:43:27 +0000
39+++ loco_directory/events/forms.py 2010-08-26 14:45:53 +0000
40@@ -112,7 +112,7 @@
41
42 class Meta:
43 model = Attendee
44- exclude = ('attendee', 'team_event')
45+ exclude = ('attendee_profile', 'team_event')
46
47 class TeamEventCommentForm(forms.ModelForm):
48 """
49@@ -120,7 +120,7 @@
50 """
51 class Meta:
52 model = TeamEventComment
53- exclude = ('team_event', 'date_created', 'comment_by')
54+ exclude = ('team_event', 'date_created', 'commenter_profile')
55
56 class EventSearchForm(forms.Form):
57 """
58
59=== added file 'loco_directory/events/migrations/0002_add_profile_fields.py'
60--- loco_directory/events/migrations/0002_add_profile_fields.py 1970-01-01 00:00:00 +0000
61+++ loco_directory/events/migrations/0002_add_profile_fields.py 2010-08-26 14:45:53 +0000
62@@ -0,0 +1,170 @@
63+
64+from south.db import db
65+from django.db import models
66+from events.models import *
67+
68+class Migration:
69+ depends_on = (
70+ ("userprofiles", "0001_initial"),
71+ )
72+
73+ def forwards(self, orm):
74+
75+ # Adding field 'TeamEventComment.commenter_profile'
76+ db.add_column('events_teameventcomment', 'commenter_profile', orm['events.TeamEventComment:commenter_profile'])
77+
78+ # Adding field 'Attendee.attendee_profile'
79+ db.add_column('events_attendee', 'attendee_profile', orm['events.Attendee:attendee_profile'])
80+
81+
82+
83+ def backwards(self, orm):
84+
85+ # Deleting field 'TeamEventComment.commenter_profile'
86+ db.delete_column('events_teameventcomment', 'commenter_profile_id')
87+
88+ # Deleting field 'Attendee.attendee_profile'
89+ db.delete_column('events_attendee', 'attendee_profile_id')
90+
91+
92+
93+ models = {
94+ 'auth.group': {
95+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
96+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
97+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
98+ },
99+ 'auth.permission': {
100+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
101+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
102+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
103+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
105+ },
106+ 'auth.user': {
107+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
108+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
109+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
110+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
111+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
113+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
114+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
115+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
116+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
117+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
118+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
119+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
120+ },
121+ 'contenttypes.contenttype': {
122+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
123+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
124+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
126+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
127+ },
128+ 'events.attendee': {
129+ 'Meta': {'unique_together': "(('team_event', 'attendee_profile'),)"},
130+ 'attendee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
131+ 'attendee_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
132+ 'guests': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
133+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
134+ 'promise': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
135+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
136+ },
137+ 'events.baseevent': {
138+ 'announce': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
139+ 'date_begin': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
140+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 9, 53, 607179)', 'db_index': 'True'}),
141+ 'date_end': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
142+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
143+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
144+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
145+ },
146+ 'events.globalevent': {
147+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
148+ 'microbloghashtag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
149+ 'pictag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
150+ },
151+ 'events.teamevent': {
152+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
153+ 'global_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.GlobalEvent']", 'null': 'True', 'blank': 'True'}),
154+ 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Team']", 'db_index': 'True'}),
155+ 'venue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['venues.Venue']", 'null': 'True', 'blank': 'True'})
156+ },
157+ 'events.teameventcomment': {
158+ 'comment': ('django.db.models.fields.TextField', [], {'db_index': 'True'}),
159+ 'comment_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
160+ 'commenter_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
161+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 9, 53, 613146)', 'db_index': 'True'}),
162+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
163+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
164+ },
165+ 'teams.continent': {
166+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
167+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
168+ },
169+ 'teams.country': {
170+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
171+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
172+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
173+ },
174+ 'teams.language': {
175+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
176+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
177+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
178+ },
179+ 'teams.team': {
180+ 'Meta': {'db_table': "'teams'"},
181+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
182+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
183+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
184+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
185+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
186+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
187+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
188+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
189+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
190+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
191+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
192+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
193+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
194+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
195+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
196+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
197+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
198+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
199+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
200+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
201+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
202+ },
203+ 'userprofiles.userprofile': {
204+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
205+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
206+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
207+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
208+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
209+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
210+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
211+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
212+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
213+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
214+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
215+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
216+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
217+ },
218+ 'venues.venue': {
219+ 'Meta': {'unique_together': "(('name', 'country', 'city'), ('longitude', 'latitude'))"},
220+ 'address': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
221+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
222+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
223+ 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['teams.Country']", 'null': 'True'}),
224+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
225+ 'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
226+ 'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
227+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
228+ 'venue_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
229+ }
230+ }
231+
232+ complete_apps = ['events']
233
234=== added file 'loco_directory/events/migrations/0003_migrate_profile_data.py'
235--- loco_directory/events/migrations/0003_migrate_profile_data.py 1970-01-01 00:00:00 +0000
236+++ loco_directory/events/migrations/0003_migrate_profile_data.py 2010-08-26 14:45:53 +0000
237@@ -0,0 +1,173 @@
238+
239+from south.db import db
240+from django.db import models
241+from events.models import *
242+
243+class Migration:
244+
245+ def forwards(self, orm):
246+ for comment in orm['events.TeamEventComment'].objects.all():
247+ if not comment.commenter_profile:
248+ commenter_profile, created = orm['userprofiles.UserProfile'].objects.get_or_create(user=comment.comment_by)
249+ if created:
250+ commenter_profile.save()
251+ comment.commenter_profile = commenter_profile
252+ comment.save()
253+ for attendee in orm['events.Attendee'].objects.all():
254+ if not attendee.attendee_profile:
255+ attendee_profile, created = orm['userprofiles.UserProfile'].objects.get_or_create(user=attendee.attendee)
256+ if created:
257+ attendee_profile.save()
258+ attendee.attendee_profile = attendee_profile
259+ attendee.save()
260+
261+ def backwards(self, orm):
262+ for comment in orm['events.TeamEventComment'].objects.all():
263+ if not comment.comment_by:
264+ comment.comment_by = comment.commenter_profile.user
265+ comment.save()
266+ for attendee in orm['events.Attendee'].objects.all():
267+ if not attendee.attendee:
268+ attendee.attendee = attendee.attendee_profile.user
269+ attendee.save()
270+
271+ models = {
272+ 'auth.group': {
273+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
274+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
275+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
276+ },
277+ 'auth.permission': {
278+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
279+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
280+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
281+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
282+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
283+ },
284+ 'auth.user': {
285+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
286+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
287+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
288+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
289+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
290+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
291+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
292+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
293+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
294+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
295+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
296+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
297+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
298+ },
299+ 'contenttypes.contenttype': {
300+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
301+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
302+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
303+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
304+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
305+ },
306+ 'events.attendee': {
307+ 'Meta': {'unique_together': "(('team_event', 'attendee_profile'),)"},
308+ 'attendee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
309+ 'attendee_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
310+ 'guests': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
311+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
312+ 'promise': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
313+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
314+ },
315+ 'events.baseevent': {
316+ 'announce': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
317+ 'date_begin': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
318+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 10, 3, 333840)', 'db_index': 'True'}),
319+ 'date_end': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
320+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
321+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
322+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
323+ },
324+ 'events.globalevent': {
325+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
326+ 'microbloghashtag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
327+ 'pictag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
328+ },
329+ 'events.teamevent': {
330+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
331+ 'global_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.GlobalEvent']", 'null': 'True', 'blank': 'True'}),
332+ 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Team']", 'db_index': 'True'}),
333+ 'venue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['venues.Venue']", 'null': 'True', 'blank': 'True'})
334+ },
335+ 'events.teameventcomment': {
336+ 'comment': ('django.db.models.fields.TextField', [], {'db_index': 'True'}),
337+ 'comment_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
338+ 'commenter_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
339+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 10, 3, 336191)', 'db_index': 'True'}),
340+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
341+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
342+ },
343+ 'teams.continent': {
344+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
345+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
346+ },
347+ 'teams.country': {
348+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
349+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
350+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
351+ },
352+ 'teams.language': {
353+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
354+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
355+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
356+ },
357+ 'teams.team': {
358+ 'Meta': {'db_table': "'teams'"},
359+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
360+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
361+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
362+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
363+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
364+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
365+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
366+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
367+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
368+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
369+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
370+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
371+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
372+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
373+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
374+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
375+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
376+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
377+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
378+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
379+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
380+ },
381+ 'userprofiles.userprofile': {
382+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
383+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
384+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
385+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
386+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
387+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
388+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
389+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
390+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
391+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
392+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
393+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
394+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
395+ },
396+ 'venues.venue': {
397+ 'Meta': {'unique_together': "(('name', 'country', 'city'), ('longitude', 'latitude'))"},
398+ 'address': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
399+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
400+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
401+ 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['teams.Country']", 'null': 'True'}),
402+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
403+ 'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
404+ 'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
405+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
406+ 'venue_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
407+ }
408+ }
409+
410+ complete_apps = ['events']
411
412=== added file 'loco_directory/events/migrations/0004_remove_user.py'
413--- loco_directory/events/migrations/0004_remove_user.py 1970-01-01 00:00:00 +0000
414+++ loco_directory/events/migrations/0004_remove_user.py 2010-08-26 14:45:53 +0000
415@@ -0,0 +1,181 @@
416+
417+from south.db import db
418+from django.db import models
419+from events.models import *
420+
421+class Migration:
422+
423+ def forwards(self, orm):
424+
425+ # Deleting field 'TeamEventComment.comment_by'
426+ db.delete_column('events_teameventcomment', 'comment_by_id')
427+
428+ # Deleting field 'Attendee.attendee'
429+ db.delete_column('events_attendee', 'attendee_id')
430+
431+ # Changing field 'BaseEvent.date_created'
432+ # (to signature: django.db.models.fields.DateTimeField(default=datetime.datetime(2010, 8, 18, 10, 11, 17, 963571), db_index=True))
433+ db.alter_column('events_baseevent', 'date_created', orm['events.baseevent:date_created'])
434+
435+ # Changing field 'TeamEventComment.date_created'
436+ # (to signature: django.db.models.fields.DateTimeField(default=datetime.datetime(2010, 8, 18, 10, 11, 17, 966242), db_index=True))
437+ db.alter_column('events_teameventcomment', 'date_created', orm['events.teameventcomment:date_created'])
438+
439+
440+
441+ def backwards(self, orm):
442+
443+ # Adding field 'TeamEventComment.comment_by'
444+ db.add_column('events_teameventcomment', 'comment_by', orm['events.teameventcomment:comment_by'])
445+
446+ # Adding field 'Attendee.attendee'
447+ db.add_column('events_attendee', 'attendee', orm['events.attendee:attendee'])
448+
449+ # Changing field 'BaseEvent.date_created'
450+ # (to signature: django.db.models.fields.DateTimeField(default=datetime.datetime(2010, 8, 18, 10, 10, 3, 333840), db_index=True))
451+ db.alter_column('events_baseevent', 'date_created', orm['events.baseevent:date_created'])
452+
453+ # Changing field 'TeamEventComment.date_created'
454+ # (to signature: django.db.models.fields.DateTimeField(default=datetime.datetime(2010, 8, 18, 10, 10, 3, 336191), db_index=True))
455+ db.alter_column('events_teameventcomment', 'date_created', orm['events.teameventcomment:date_created'])
456+
457+
458+
459+ models = {
460+ 'auth.group': {
461+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
462+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
463+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
464+ },
465+ 'auth.permission': {
466+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
467+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
468+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
469+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
470+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
471+ },
472+ 'auth.user': {
473+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
474+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
475+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
476+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
477+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
478+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
479+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
480+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
481+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
482+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
483+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
484+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
485+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
486+ },
487+ 'contenttypes.contenttype': {
488+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
489+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
490+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
491+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
492+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
493+ },
494+ 'events.attendee': {
495+ 'Meta': {'unique_together': "(('team_event', 'attendee_profile'),)"},
496+ 'attendee_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
497+ 'guests': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
498+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
499+ 'promise': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
500+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
501+ },
502+ 'events.baseevent': {
503+ 'announce': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
504+ 'date_begin': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
505+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 11, 17, 963571)', 'db_index': 'True'}),
506+ 'date_end': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}),
507+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
508+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
509+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
510+ },
511+ 'events.globalevent': {
512+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
513+ 'microbloghashtag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
514+ 'pictag': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
515+ },
516+ 'events.teamevent': {
517+ 'baseevent_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['events.BaseEvent']", 'unique': 'True', 'primary_key': 'True'}),
518+ 'global_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.GlobalEvent']", 'null': 'True', 'blank': 'True'}),
519+ 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Team']", 'db_index': 'True'}),
520+ 'venue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['venues.Venue']", 'null': 'True', 'blank': 'True'})
521+ },
522+ 'events.teameventcomment': {
523+ 'comment': ('django.db.models.fields.TextField', [], {'db_index': 'True'}),
524+ 'commenter_profile': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['userprofiles.UserProfile']", 'null': 'True'}),
525+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2010, 8, 18, 10, 11, 17, 966242)', 'db_index': 'True'}),
526+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
527+ 'team_event': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['events.TeamEvent']"})
528+ },
529+ 'teams.continent': {
530+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
531+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
532+ },
533+ 'teams.country': {
534+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
535+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
536+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
537+ },
538+ 'teams.language': {
539+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
540+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
541+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
542+ },
543+ 'teams.team': {
544+ 'Meta': {'db_table': "'teams'"},
545+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
546+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
547+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
548+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
549+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
550+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
551+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
552+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
553+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
554+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
555+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
556+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
557+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
558+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
559+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
560+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
561+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
562+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
563+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
564+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
565+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
566+ },
567+ 'userprofiles.userprofile': {
568+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
569+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
570+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
571+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
572+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
573+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
574+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
575+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
576+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
577+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
578+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
579+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
580+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
581+ },
582+ 'venues.venue': {
583+ 'Meta': {'unique_together': "(('name', 'country', 'city'), ('longitude', 'latitude'))"},
584+ 'address': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
585+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
586+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
587+ 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['teams.Country']", 'null': 'True'}),
588+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
589+ 'latitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
590+ 'longitude': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
591+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
592+ 'venue_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
593+ }
594+ }
595+
596+ complete_apps = ['events']
597
598=== modified file 'loco_directory/events/models.py'
599--- loco_directory/events/models.py 2010-08-18 16:18:41 +0000
600+++ loco_directory/events/models.py 2010-08-26 14:45:53 +0000
601@@ -1,5 +1,5 @@
602 from django.db import models
603-from django.contrib.auth.models import User
604+from userprofiles.models import UserProfile
605 from teams.models import *
606 from venues.models import Venue
607 from django.utils.translation import ugettext_lazy as _
608@@ -120,7 +120,7 @@
609
610 def is_attending(self, user):
611 if user.is_authenticated():
612- return self.attendee_set.filter(attendee=user).count() > 0
613+ return self.attendee_set.filter(attendee_profile__user=user).count() > 0
614 else:
615 return False
616
617@@ -145,7 +145,7 @@
618 """
619 team_event = models.ForeignKey(TeamEvent, help_text=_('the Team Event'))
620 date_created = models.DateTimeField(help_text=_('the date and time when the event comment was created'), default=datetime.datetime.now(), db_index=True)
621- comment_by = models.ForeignKey(User)
622+ commenter_profile = models.ForeignKey(UserProfile, null=True)
623 comment = models.TextField(help_text=_('Comment this Event'), db_index=True)
624
625 def __unicode__(self):
626@@ -158,14 +158,14 @@
627 a event attendee
628 """
629 class Meta:
630- unique_together = ('team_event', 'attendee')
631+ unique_together = ('team_event', 'attendee_profile')
632
633 team_event = models.ForeignKey(TeamEvent, help_text=_('the Team Event'))
634- attendee = models.ForeignKey(User, help_text=_('the name of the attendee'))
635+ attendee_profile = models.ForeignKey(UserProfile, help_text=_('the name of the attendee'), null=True)
636 promise = models.CharField(verbose_name=_('Attending Status'), max_length=50, choices=ATTENDEE_PROMISE_CHOICES)
637 guests = models.PositiveSmallIntegerField(verbose_name=_('Additional Guests'))
638
639 def __unicode__(self):
640- return self.attendee
641+ return self.attendee_profile.user.username
642
643
644
645=== modified file 'loco_directory/events/views.py'
646--- loco_directory/events/views.py 2010-08-17 14:40:36 +0000
647+++ loco_directory/events/views.py 2010-08-26 14:45:53 +0000
648@@ -304,9 +304,11 @@
649 """
650 team_event_object = get_object_or_404(TeamEvent, pk=team_event_id)
651 if team_event_object.is_attending(request.user):
652- attendee_object = team_event_object.attendee_set.get(attendee=request.user)
653+ attendee_object = team_event_object.attendee_set.get(attendee_profile__user=request.user)
654 else:
655- attendee_object = Attendee(team_event=team_event_object, attendee=request.user)
656+ from userprofiles.models import create_profile
657+ profile = create_profile(request.user.username)
658+ attendee_object = Attendee(team_event=team_event_object, attendee_profile=profile)
659
660 if request.method == 'POST':
661 form = AttendeeRegistrationForm(instance=attendee_object, data=request.POST)
662@@ -341,7 +343,9 @@
663 if form.is_valid():
664 team_event_comment = form.save(commit=False)
665 team_event_comment.team_event = team_event_object
666- team_event_comment.comment_by = request.user
667+ from userprofiles.models import create_profile
668+ profile = create_profile(request.user.username)
669+ team_event_comment.commenter_profile = profile
670 team_event_comment.save()
671 request.user.message_set.create(message=_('Comment saved.'))
672 return redirect( team_event_object )
673
674=== modified file 'loco_directory/services/urls.py'
675--- loco_directory/services/urls.py 2010-07-15 16:47:45 +0000
676+++ loco_directory/services/urls.py 2010-08-26 14:45:53 +0000
677@@ -17,7 +17,7 @@
678 url(r'^venues/(.*)$', 'services.views.venue_service', name='venue_service'),
679 url(r'^users/(.*)$', 'services.views.user_service', name='user_service'),
680 url(r'^groups/(.*)$', 'services.views.group_service', name='group_service'),
681- url(r'^admins/(.*)$', 'services.views.admin_service', name='admin_service'),
682+ url(r'^profiles/(.*)$', 'services.views.profile_service', name='profile_service'),
683 url(r'^languages/(.*)$', 'services.views.language_service', name='language_service'),
684 )
685
686
687=== modified file 'loco_directory/services/views.py'
688--- loco_directory/services/views.py 2010-07-15 16:32:07 +0000
689+++ loco_directory/services/views.py 2010-08-26 14:45:53 +0000
690@@ -1,6 +1,7 @@
691 from teams.models import Team, Continent, Country, Language
692-from events.models import GlobalEvent, TeamEvent, TeamEventComment, Attendee, TeamAdministrator
693+from events.models import GlobalEvent, TeamEvent, TeamEventComment, Attendee
694 from venues.models import Venue
695+from userprofiles.models import UserProfile
696 from django.contrib.auth.models import User, Group
697
698 from services import model_service
699@@ -35,8 +36,8 @@
700 def group_service(request, url):
701 return model_service(Group, request, url, exclude=['permissions'])
702
703-def admin_service(request, url):
704- return model_service(TeamAdministrator, request, url)
705+def profile_service(request, url):
706+ return model_service(UserProfile, request, url, exclude=['user'])
707
708 def language_service(request, url):
709 return model_service(Language, request, url)
710
711=== modified file 'loco_directory/settings.py'
712--- loco_directory/settings.py 2010-08-20 13:05:47 +0000
713+++ loco_directory/settings.py 2010-08-26 14:45:53 +0000
714@@ -115,6 +115,7 @@
715 'teams',
716 'venues',
717 'events',
718+ 'userprofiles',
719 'django_openid_auth',
720 'south',
721 )
722@@ -124,6 +125,8 @@
723 'django.contrib.auth.backends.ModelBackend',
724 )
725
726+AUTH_PROFILE_MODULE = 'userprofiles.UserProfile'
727+
728 # Should users be created when new OpenIDs are used to log in?
729 OPENID_CREATE_USERS = True
730
731
732=== modified file 'loco_directory/teams/admin.py'
733--- loco_directory/teams/admin.py 2010-07-09 10:56:49 +0000
734+++ loco_directory/teams/admin.py 2010-08-26 14:45:53 +0000
735@@ -1,7 +1,7 @@
736 # -*- coding: utf-8 -*-
737
738 from django.contrib import admin
739-from teams.models import Team, TeamAdministrator, Continent, Country, Language
740+from teams.models import Team, Continent, Country, Language
741
742 class TeamAdmin(admin.ModelAdmin):
743 search_fields = ('name',)
744@@ -12,10 +12,6 @@
745 field.widget.attrs['rows'] = '4'
746 return field
747
748-class TeamAdministratorAdmin(admin.ModelAdmin):
749- search_fields = ('lpid',)
750- list_display = ('lpid',)
751-
752 class ContinentAdmin(admin.ModelAdmin):
753 search_fields = ('name',)
754
755@@ -26,7 +22,6 @@
756 search_fields = ('name',)
757
758 admin.site.register(Team, TeamAdmin)
759-admin.site.register(TeamAdministrator, TeamAdministratorAdmin)
760 admin.site.register(Continent, ContinentAdmin)
761 admin.site.register(Country, CountryAdmin)
762 admin.site.register(Language, LanguageAdmin)
763
764=== modified file 'loco_directory/teams/management/commands/lpupdate.py'
765--- loco_directory/teams/management/commands/lpupdate.py 2010-08-12 09:59:25 +0000
766+++ loco_directory/teams/management/commands/lpupdate.py 2010-08-26 14:45:53 +0000
767@@ -5,20 +5,33 @@
768 from common import launchpad
769 from teams import models
770 from django.contrib.auth.models import Group
771+from userprofiles.models import create_profile
772
773 from datetime import datetime
774 import sys
775
776-def update_admins(ld_team, lp_team):
777- ld_admin_names = set([a.lpid for a in ld_team.admins.all()])
778- lp_admin_names = set([a.name for a in lp_team.getMembersByStatus(status='Administrator')])
779- for admin_name in ld_admin_names.difference(lp_admin_names):
780- admin = ld_team.admins.get(lpid=admin_name)
781- admin.delete()
782- for admin_name in lp_admin_names.difference(ld_admin_names):
783- admin = models.TeamAdministrator(lpid=admin_name)
784+def create_admin_dict(admins):
785+ admin_dict = {}
786+ for (lpid, realname) in admins:
787+ admin_dict[lpid] = realname
788+ return admin_dict
789+
790+def update_admins(ld_team, lp_team, lp):
791+ ld_admin_names = create_admin_dict([(a.user.username, a.realname) \
792+ for a in ld_team.admin_profiles.all()])
793+ lp_admin_names = create_admin_dict([(a.name, a.display_name) \
794+ for a in lp_team.getMembersByStatus(status='Administrator')])
795+ ld_admin_set = set(ld_admin_names.keys())
796+ lp_admin_set = set(lp_admin_names.keys())
797+ for admin_name in ld_admin_set.difference(lp_admin_set):
798+ admin = ld_team.admin_profiles.get(user__username=admin_name)
799+ admin.delete()
800+ for admin_name in lp_admin_set.difference(ld_admin_set):
801+ admin = create_profile(admin_name)
802+ admin.realname = lp_admin_names[admin_name]
803+ admin.tz = launchpad.get_user_timezone(admin_name, lp)
804 admin.save()
805- ld_team.admins.add(admin)
806+ ld_team.admin_profiles.add(admin)
807
808
809 class Command(NoArgsCommand):
810@@ -36,13 +49,14 @@
811 lp.people["locoteams"].members)
812 for l in locos:
813 if not existing_locos or l.name not in [b.lp_name for b in existing_locos]:
814- team = models.Team(lp_name=l.name, name=l.display_name, owner=l.team_owner.name)
815+ team = models.Team(lp_name=l.name, name=l.display_name,
816+ owner_profile=create_profile(l.team_owner.name))
817 team.save()
818 else:
819 team = filter(lambda a: a.lp_name == l.name, existing_locos)[0]
820 team.name = l.display_name
821- team.owner = l.team_owner.name
822- update_admins(team, l)
823+ team.owner_profile = create_profile(l.team_owner.name)
824+ update_admins(team, l, lp)
825
826 if not existing_groups or l.name not in [g.name for g in existing_groups]:
827 group = Group(name=l.name)
828
829=== modified file 'loco_directory/teams/migrations/0002_add_mugshot_field.py'
830--- loco_directory/teams/migrations/0002_add_mugshot_field.py 2010-02-04 00:39:29 +0000
831+++ loco_directory/teams/migrations/0002_add_mugshot_field.py 2010-08-26 14:45:53 +0000
832@@ -13,6 +13,7 @@
833
834
835 def backwards(self, orm):
836+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
837
838 # Deleting field 'Team.mugshot_url'
839 db.delete_column('teams', 'mugshot_url')
840
841=== added file 'loco_directory/teams/migrations/0005_add_profile_fields.py'
842--- loco_directory/teams/migrations/0005_add_profile_fields.py 1970-01-01 00:00:00 +0000
843+++ loco_directory/teams/migrations/0005_add_profile_fields.py 2010-08-26 14:45:53 +0000
844@@ -0,0 +1,142 @@
845+
846+from south.db import db
847+from django.db import models
848+from teams.models import *
849+
850+class Migration:
851+ depends_on = (
852+ ("userprofiles", "0001_initial"),
853+ )
854+
855+ def forwards(self, orm):
856+
857+ # Adding field 'Team.owner_profile'
858+ db.add_column('teams', 'owner_profile', orm['teams.team:owner_profile'])
859+
860+ # Adding ManyToManyField 'Team.admin_profiles'
861+ db.create_table('teams_admin_profiles', (
862+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
863+ ('team', models.ForeignKey(orm.Team, null=False)),
864+ ('userprofile', models.ForeignKey(orm['userprofiles.UserProfile'], null=False))
865+ ))
866+
867+ # Adding ManyToManyField 'Team.contact_profiles'
868+ db.create_table('teams_contact_profiles', (
869+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
870+ ('team', models.ForeignKey(orm.Team, null=False)),
871+ ('userprofile', models.ForeignKey(orm['userprofiles.UserProfile'], null=False))
872+ ))
873+
874+
875+
876+ def backwards(self, orm):
877+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
878+
879+ # Deleting field 'Team.owner_profile'
880+ db.delete_column('teams', 'owner_profile_id')
881+
882+ # Dropping ManyToManyField 'Team.admin_profiles'
883+ db.delete_table('teams_admin_profiles')
884+
885+ # Dropping ManyToManyField 'Team.contact_profiles'
886+ db.delete_table('teams_contact_profiles')
887+
888+
889+
890+ models = {
891+ 'auth.group': {
892+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
893+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
894+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
895+ },
896+ 'auth.permission': {
897+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
898+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
899+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
900+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
901+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
902+ },
903+ 'auth.user': {
904+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
905+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
906+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
907+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
908+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
909+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
910+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
911+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
912+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
913+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
914+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
915+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
916+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
917+ },
918+ 'contenttypes.contenttype': {
919+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
920+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
921+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
922+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
923+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
924+ },
925+ 'teams.continent': {
926+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
927+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
928+ },
929+ 'teams.country': {
930+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
931+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
932+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
933+ },
934+ 'teams.language': {
935+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
936+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
937+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
938+ },
939+ 'teams.team': {
940+ 'Meta': {'db_table': "'teams'"},
941+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
942+ 'admins': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.TeamAdministrator']"}),
943+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
944+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
945+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
946+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
947+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
948+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
949+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
950+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
951+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
952+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
953+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
954+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
955+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
956+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
957+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
958+ 'owner': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}),
959+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
960+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
961+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
962+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
963+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
964+ },
965+ 'teams.teamadministrator': {
966+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
967+ 'lpid': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'db_index': 'True'})
968+ },
969+ 'userprofiles.userprofile': {
970+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
971+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
972+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
973+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
974+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
975+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
976+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
977+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
978+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
979+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
980+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
981+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
982+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
983+ }
984+ }
985+
986+ complete_apps = ['teams']
987
988=== added file 'loco_directory/teams/migrations/0006_migrate_profile_fields.py'
989--- loco_directory/teams/migrations/0006_migrate_profile_fields.py 1970-01-01 00:00:00 +0000
990+++ loco_directory/teams/migrations/0006_migrate_profile_fields.py 2010-08-26 14:45:53 +0000
991@@ -0,0 +1,140 @@
992+
993+from south.db import db
994+from django.db import models
995+from teams.models import *
996+
997+def _create_profile(orm, lpid):
998+ user, created = orm['auth.User'].objects.get_or_create(username=lpid)
999+ if created:
1000+ user.save()
1001+ profile, created = orm['userprofiles.UserProfile'].objects.get_or_create(user=user)
1002+ if created:
1003+ # set real name as lpid for now, we get the name later on via cronjob
1004+ profile.realname = lpid
1005+ profile.save()
1006+ return profile
1007+
1008+class Migration:
1009+
1010+ def forwards(self, orm):
1011+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
1012+ for team in orm['teams.Team'].objects.all():
1013+ if not team.owner_profile:
1014+ team.owner_profile = _create_profile(orm, team.owner)
1015+ for admin in team.admins.all():
1016+ admin_profile = _create_profile(orm, admin.lpid)
1017+ team.admin_profiles.add(admin_profile)
1018+ team.save()
1019+
1020+
1021+ def backwards(self, orm):
1022+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
1023+ for team in orm['teams.Team'].objects.all():
1024+ if not team.owner:
1025+ team.owner = team.owner_profile.user.username
1026+ # for some reason TeamAdministrator was never unique
1027+ for admin_profile in team.admin_profiles.all():
1028+ if orm['teams.TeamAdministrator'].objects.filter(lpid=admin_profile.user.username):
1029+ admin = orm['teams.TeamAdministrator'].objects.filter(lpid=admin_profile.user.username)[0]
1030+ else:
1031+ admin = orm['teams.TeamAdministrator'].objects.create(lpid=admin_profile.user.username)
1032+ admin.save()
1033+ team.save()
1034+
1035+ models = {
1036+ 'auth.group': {
1037+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1038+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
1039+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
1040+ },
1041+ 'auth.permission': {
1042+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
1043+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1044+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
1045+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1046+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
1047+ },
1048+ 'auth.user': {
1049+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1050+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
1051+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1052+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
1053+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1054+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
1055+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1056+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1057+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1058+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1059+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
1060+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
1061+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
1062+ },
1063+ 'contenttypes.contenttype': {
1064+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
1065+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1066+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1067+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1068+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
1069+ },
1070+ 'teams.continent': {
1071+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1072+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
1073+ },
1074+ 'teams.country': {
1075+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
1076+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1077+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
1078+ },
1079+ 'teams.language': {
1080+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
1081+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1082+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
1083+ },
1084+ 'teams.team': {
1085+ 'Meta': {'db_table': "'teams'"},
1086+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
1087+ 'admins': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.TeamAdministrator']"}),
1088+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1089+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
1090+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
1091+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
1092+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
1093+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
1094+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
1095+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1096+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1097+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
1098+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
1099+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
1100+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1101+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1102+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
1103+ 'owner': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}),
1104+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
1105+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
1106+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
1107+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1108+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
1109+ },
1110+ 'teams.teamadministrator': {
1111+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1112+ 'lpid': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'db_index': 'True'})
1113+ },
1114+ 'userprofiles.userprofile': {
1115+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1116+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1117+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1118+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1119+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1120+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1121+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1122+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1123+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
1124+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1125+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
1126+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
1127+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
1128+ }
1129+ }
1130+
1131+ complete_apps = ['teams']
1132
1133=== added file 'loco_directory/teams/migrations/0007_remove_old_person_fields.py'
1134--- loco_directory/teams/migrations/0007_remove_old_person_fields.py 1970-01-01 00:00:00 +0000
1135+++ loco_directory/teams/migrations/0007_remove_old_person_fields.py 2010-08-26 14:45:53 +0000
1136@@ -0,0 +1,136 @@
1137+
1138+from south.db import db
1139+from django.db import models
1140+from teams.models import *
1141+
1142+class Migration:
1143+
1144+ def forwards(self, orm):
1145+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
1146+ # Dropping ManyToManyField 'Team.admins'
1147+ db.delete_table('teams_admins')
1148+
1149+ # Deleting field 'Team.owner'
1150+ db.delete_column('teams', 'owner')
1151+
1152+ # Deleting model 'teamadministrator'
1153+ db.delete_table('teams_teamadministrator')
1154+
1155+
1156+
1157+ def backwards(self, orm):
1158+ db.current_orm.models['teams'] = db.current_orm.models['teams.team']
1159+ # Adding ManyToManyField 'Team.admins'
1160+ db.create_table('teams_admins', (
1161+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
1162+ ('team', models.ForeignKey(orm.Team, null=False)),
1163+ ('teamadministrator', models.ForeignKey(orm.teamadministrator, null=False))
1164+ ))
1165+
1166+ # Adding field 'Team.owner'
1167+ db.add_column('teams', 'owner', orm['teams.team:owner'])
1168+
1169+ # Adding model 'teamadministrator'
1170+ db.create_table('teams_teamadministrator', (
1171+ ('id', orm['teams.TeamAdministrator:id']),
1172+ ('lpid', orm['teams.TeamAdministrator:lpid']),
1173+ ))
1174+ db.send_create_signal('teams', ['teamadministrator'])
1175+
1176+
1177+
1178+ models = {
1179+ 'auth.group': {
1180+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1181+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
1182+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
1183+ },
1184+ 'auth.permission': {
1185+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
1186+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1187+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
1188+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1189+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
1190+ },
1191+ 'auth.user': {
1192+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1193+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
1194+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1195+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
1196+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1197+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
1198+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1199+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1200+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1201+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1202+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
1203+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
1204+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
1205+ },
1206+ 'contenttypes.contenttype': {
1207+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
1208+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1209+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1210+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1211+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
1212+ },
1213+ 'teams.continent': {
1214+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1215+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
1216+ },
1217+ 'teams.country': {
1218+ 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
1219+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1220+ 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
1221+ },
1222+ 'teams.language': {
1223+ 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
1224+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1225+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
1226+ },
1227+ 'teams.team': {
1228+ 'Meta': {'db_table': "'teams'"},
1229+ 'admin_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
1230+ 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1231+ 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
1232+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
1233+ 'contact_profiles': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['userprofiles.UserProfile']"}),
1234+ 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
1235+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
1236+ 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
1237+ 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1238+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1239+ 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
1240+ 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
1241+ 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
1242+ 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1243+ 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1244+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
1245+ 'owner_profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owner'", 'null': 'True', 'to': "orm['userprofiles.UserProfile']"}),
1246+ 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
1247+ 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
1248+ 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1249+ 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
1250+ },
1251+ 'teams.teamadministrator': {
1252+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key' : 'True'}),
1253+ 'lpid': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'db_index': 'True'}),
1254+ },
1255+ 'userprofiles.userprofile': {
1256+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1257+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1258+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1259+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1260+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1261+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1262+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1263+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1264+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
1265+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1266+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
1267+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
1268+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
1269+ }
1270+ }
1271+
1272+ complete_apps = ['teams']
1273
1274=== modified file 'loco_directory/teams/models.py'
1275--- loco_directory/teams/models.py 2010-07-30 20:55:49 +0000
1276+++ loco_directory/teams/models.py 2010-08-26 14:45:53 +0000
1277@@ -2,6 +2,7 @@
1278 from django.utils.translation import ugettext_lazy as _
1279
1280 from common.utils import flat_list
1281+from userprofiles.models import UserProfile
1282
1283 class Language(models.Model):
1284 class Meta:
1285@@ -15,11 +16,6 @@
1286 class TeamManager(models.Manager):
1287 pass
1288
1289-class TeamAdministrator(models.Model):
1290- lpid = models.SlugField(_("Launchpad ID"), max_length=40, null=False, blank=False)
1291- def __unicode__(self):
1292- return u'%s' % (self.lpid)
1293-
1294 class Continent(models.Model):
1295 name = models.TextField(_("Name"), max_length=50)
1296
1297@@ -84,8 +80,9 @@
1298 approved = models.BooleanField(_("Approved Team"), default=False)
1299 approved_date = models.DateField(_("Date Approved"), null=True, blank=True)
1300 expires_date = models.DateField(_("Date Expires"), null=True, blank=True)
1301- owner = models.SlugField(_("Launchpad Team Owner"), null=True, blank=False)
1302- admins = models.ManyToManyField(TeamAdministrator)
1303+ owner_profile = models.ForeignKey(UserProfile, related_name='owner', null=True)
1304+ admin_profiles = models.ManyToManyField(UserProfile, related_name='admins')
1305+ contact_profiles = models.ManyToManyField(UserProfile, related_name='contacts')
1306 mugshot_url = models.URLField(_("URL of mugshot"), verify_exists=False, null=True, blank=True)
1307 languages = models.ManyToManyField(Language)
1308
1309
1310=== modified file 'loco_directory/templates/events/team_event_detail_attendees.inc.html'
1311--- loco_directory/templates/events/team_event_detail_attendees.inc.html 2010-08-16 18:14:57 +0000
1312+++ loco_directory/templates/events/team_event_detail_attendees.inc.html 2010-08-26 14:45:53 +0000
1313@@ -27,7 +27,7 @@
1314 </tr>
1315 {% for registration in team_event_object.attendee_set.all %}
1316 <tr class="team_event_list_row {% cycle "odd" "even" %}">
1317- <td align="center">{{registration.attendee.username}}</td>
1318+ <td align="center"><a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}">{{registration.attendee_profile.realname}}</a></td>
1319 <td align="center">{{registration.get_promise_display}}</td>
1320 <td align="center">{{registration.guests}}</td>
1321 </tr>
1322
1323=== modified file 'loco_directory/templates/events/team_event_detail_comments.inc.html'
1324--- loco_directory/templates/events/team_event_detail_comments.inc.html 2010-08-16 18:14:57 +0000
1325+++ loco_directory/templates/events/team_event_detail_comments.inc.html 2010-08-26 14:45:53 +0000
1326@@ -16,7 +16,7 @@
1327 </tr>
1328 {% for comment in comment_date.list %}
1329 <tr>
1330- <th class="form-item-label" scope="row"><label>{{comment.comment_by}}:</label></th>
1331+ <th class="form-item-label" scope="row"><label><a href="https://launchpad.net/~{{comment.commenter_profile.user.username}}">{{comment.commenter_profile.realname}}</a>:</label></th>
1332 <td class="form-item-value">{{comment.comment}}</td>
1333 </tr>
1334 {% endfor %}
1335
1336=== modified file 'loco_directory/templates/teams/team_detail.html'
1337--- loco_directory/templates/teams/team_detail.html 2010-08-23 08:18:37 +0000
1338+++ loco_directory/templates/teams/team_detail.html 2010-08-26 14:45:53 +0000
1339@@ -50,7 +50,7 @@
1340
1341 <tr>
1342 <th class="form-item-label" scope="row"><label>{% trans "Launchpad Team Owner:" %}</label></th>
1343- <td class="form-item-value"><a href="https://launchpad.net/~{{ team.owner }}">{{ team.owner }}</a></td>
1344+ <td class="form-item-value"><a href="https://launchpad.net/~{{ team.owner_profile.user.username }}">{{ team.owner_profile.realname }}</a></td>
1345 </tr>
1346
1347 {% if team.approved_date %}
1348@@ -71,8 +71,14 @@
1349 </tr>
1350 <tr>
1351 <th class="form-item-label" scope="row"><label>{% trans "Launchpad Team Admin(s):" %}</label></th>
1352- <td class="form-item-value">{% for admin in team.admins.all %}
1353- <a href="https://launchpad.net/~{{ admin.lpid }}">{{ admin.lpid }}</a>{% if not forloop.last %},{% endif %}
1354+ <td class="form-item-value">{% for admin in team.admin_profiles.all %}
1355+ <a href="https://launchpad.net/~{{ admin.user.username }}">{{ admin.realname }}</a>{% if not forloop.last %},{% endif %}
1356+ {% endfor %}</td>
1357+ </tr>
1358+ <tr>
1359+ <th class="form-item-label" scope="row"><label>{% trans "Loco Contacts(s):" %}</label></th>
1360+ <td class="form-item-value">{% for contact in team.contact_profiles.all %}
1361+ <a href="https://launchpad.net/~{{ contact.user.username }}">{{ contact.realname }}</a>{% if not forloop.last %},{% endif %}
1362 {% endfor %}</td>
1363 </tr>
1364
1365
1366=== added directory 'loco_directory/userprofiles'
1367=== added file 'loco_directory/userprofiles/__init__.py'
1368=== added file 'loco_directory/userprofiles/admin.py'
1369--- loco_directory/userprofiles/admin.py 1970-01-01 00:00:00 +0000
1370+++ loco_directory/userprofiles/admin.py 2010-08-26 14:45:53 +0000
1371@@ -0,0 +1,7 @@
1372+from django.contrib import admin
1373+from userprofiles.models import UserProfile
1374+
1375+class UserProfileAdmin(admin.ModelAdmin):
1376+ search_fields = ('realname',)
1377+
1378+admin.site.register(UserProfile, UserProfileAdmin)
1379
1380=== added directory 'loco_directory/userprofiles/migrations'
1381=== added file 'loco_directory/userprofiles/migrations/0001_initial.py'
1382--- loco_directory/userprofiles/migrations/0001_initial.py 1970-01-01 00:00:00 +0000
1383+++ loco_directory/userprofiles/migrations/0001_initial.py 2010-08-26 14:45:53 +0000
1384@@ -0,0 +1,89 @@
1385+
1386+from south.db import db
1387+from django.db import models
1388+from userprofiles.models import *
1389+
1390+class Migration:
1391+
1392+ def forwards(self, orm):
1393+
1394+ # Adding model 'UserProfile'
1395+ db.create_table('userprofiles_userprofile', (
1396+ ('id', orm['userprofiles.UserProfile:id']),
1397+ ('user', orm['userprofiles.UserProfile:user']),
1398+ ('realname', orm['userprofiles.UserProfile:realname']),
1399+ ('tz', orm['userprofiles.UserProfile:tz']),
1400+ ('blog', orm['userprofiles.UserProfile:blog']),
1401+ ('twitter', orm['userprofiles.UserProfile:twitter']),
1402+ ('identica', orm['userprofiles.UserProfile:identica']),
1403+ ('picasa', orm['userprofiles.UserProfile:picasa']),
1404+ ('flickr', orm['userprofiles.UserProfile:flickr']),
1405+ ('facebook', orm['userprofiles.UserProfile:facebook']),
1406+ ('irc', orm['userprofiles.UserProfile:irc']),
1407+ ('aim', orm['userprofiles.UserProfile:aim']),
1408+ ('xmpp', orm['userprofiles.UserProfile:xmpp']),
1409+ ))
1410+ db.send_create_signal('userprofiles', ['UserProfile'])
1411+
1412+
1413+
1414+ def backwards(self, orm):
1415+
1416+ # Deleting model 'UserProfile'
1417+ db.delete_table('userprofiles_userprofile')
1418+
1419+
1420+
1421+ models = {
1422+ 'auth.group': {
1423+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1424+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
1425+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
1426+ },
1427+ 'auth.permission': {
1428+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
1429+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1430+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
1431+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1432+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
1433+ },
1434+ 'auth.user': {
1435+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1436+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
1437+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1438+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
1439+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1440+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
1441+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1442+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
1443+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
1444+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
1445+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
1446+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
1447+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
1448+ },
1449+ 'contenttypes.contenttype': {
1450+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
1451+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1452+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1453+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
1454+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
1455+ },
1456+ 'userprofiles.userprofile': {
1457+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1458+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
1459+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1460+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1461+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
1462+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1463+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1464+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1465+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
1466+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
1467+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
1468+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
1469+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
1470+ }
1471+ }
1472+
1473+ complete_apps = ['userprofiles']
1474
1475=== added file 'loco_directory/userprofiles/migrations/__init__.py'
1476=== added file 'loco_directory/userprofiles/models.py'
1477--- loco_directory/userprofiles/models.py 1970-01-01 00:00:00 +0000
1478+++ loco_directory/userprofiles/models.py 2010-08-26 14:45:53 +0000
1479@@ -0,0 +1,60 @@
1480+from django.db import models
1481+from django.utils.translation import ugettext_lazy as _
1482+from django.contrib.auth import models as auth_models
1483+# Create your models here.
1484+
1485+class UserProfile(models.Model):
1486+ " Store profile information about a user "
1487+
1488+ user = models.OneToOneField(auth_models.User)
1489+ realname = models.CharField(_("Real Name"), max_length=150, blank=True)
1490+ tz = models.CharField(verbose_name=_('Timezone'), max_length=32, default='UTC')
1491+
1492+ blog = models.URLField(verbose_name=_('Blog URL'), blank=True, null=True, verify_exists=False)
1493+ twitter = models.CharField(verbose_name=_('Twitter ID'), max_length=32, blank=True, null=True)
1494+ identica = models.CharField(verbose_name=_('Identi.ca ID'), max_length=32, blank=True, null=True)
1495+ picasa = models.CharField(verbose_name=_('Picasa ID'), max_length=32, blank=True, null=True)
1496+ flickr = models.CharField(verbose_name=_('Flickr ID'), max_length=32, blank=True, null=True)
1497+ facebook = models.CharField(verbose_name=_('Facebook ID'), max_length=32, blank=True, null=True)
1498+ irc = models.CharField(verbose_name=_('IRC Nick'), max_length=32, blank=True, null=True)
1499+ aim = models.CharField(verbose_name=_('AOL IM Nick'), max_length=32, blank=True, null=True)
1500+ xmpp = models.CharField(verbose_name=_('XMPP IM Nick'), max_length=32, blank=True, null=True)
1501+
1502+ def __unicode__(self):
1503+ try:
1504+ if self.realname:
1505+ return "%s (%s)" % (self.user.username, self.realname)
1506+ return "%s" % self.user.username
1507+ except:
1508+ return "Unknown Profile"
1509+
1510+def _getUserProfile(self):
1511+ if not self.is_authenticated():
1512+ return UserProfile()
1513+
1514+ profile, created = UserProfile.objects.get_or_create(user=self)
1515+
1516+ if created:
1517+ from common.launchpad import get_user_timezone
1518+ profile.tz = get_user_timezone(self.username)
1519+ profile.save()
1520+
1521+ return profile
1522+
1523+def _getAnonProfile(self):
1524+ return UserProfile()
1525+
1526+auth_models.User.profile = property(_getUserProfile)
1527+auth_models.AnonymousUser.profile = property(_getAnonProfile)
1528+
1529+def create_profile(username):
1530+ user, created = auth_models.User.objects.get_or_create(username=username)
1531+ if created:
1532+ user.save()
1533+ profile, created = UserProfile.objects.get_or_create(user=user)
1534+ if created:
1535+ # set real name as username for now,
1536+ # we get the name later on via cronjob
1537+ profile.realname = username
1538+ profile.save()
1539+ return profile

Subscribers

People subscribed via source and target branches