Commit 8395e5b1dbef159499817787868cf5d3003e37d5

Authored by Luan
1 parent 3ecda96a

Adding identi_ca field to user

src/accounts/forms.py
@@ -61,7 +61,7 @@ class UserUpdateForm(UserForm): @@ -61,7 +61,7 @@ class UserUpdateForm(UserForm):
61 model = User 61 model = User
62 fields = ('first_name', 'last_name', 62 fields = ('first_name', 'last_name',
63 'institution', 'role', 'twitter', 'facebook', 63 'institution', 'role', 'twitter', 'facebook',
64 - 'google_talk', 'webpage', 'bio') 64 + 'google_talk', 'identi_ca', 'webpage', 'bio')
65 65
66 twitter = SocialAccountField(url='https://twitter.com/', required=False) 66 twitter = SocialAccountField(url='https://twitter.com/', required=False)
67 facebook = SocialAccountField(url='https://graph.facebook.com/', required=False) 67 facebook = SocialAccountField(url='https://graph.facebook.com/', required=False)
src/accounts/migrations/0009_auto__add_field_user_identi_ca.py 0 → 100644
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
  1 +# -*- coding: utf-8 -*-
  2 +import datetime
  3 +from south.db import db
  4 +from south.v2 import SchemaMigration
  5 +from django.db import models
  6 +
  7 +
  8 +class Migration(SchemaMigration):
  9 +
  10 + def forwards(self, orm):
  11 + # Adding field 'User.identi_ca'
  12 + db.add_column(u'accounts_user', 'identi_ca',
  13 + self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True),
  14 + keep_default=False)
  15 +
  16 +
  17 + def backwards(self, orm):
  18 + # Deleting field 'User.identi_ca'
  19 + db.delete_column(u'accounts_user', 'identi_ca')
  20 +
  21 +
  22 + models = {
  23 + u'accounts.user': {
  24 + 'Meta': {'object_name': 'User'},
  25 + 'bio': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
  26 + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  27 + 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
  28 + 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  29 + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  30 + 'google_talk': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
  31 + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
  32 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  33 + 'identi_ca': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  34 + 'institution': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  35 + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  36 + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  37 + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  38 + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  39 + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  40 + 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  41 + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  42 + 'role': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  43 + 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
  44 + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
  45 + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),
  46 + 'verification_hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
  47 + 'webpage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'})
  48 + },
  49 + u'auth.group': {
  50 + 'Meta': {'object_name': 'Group'},
  51 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  52 + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  53 + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  54 + },
  55 + u'auth.permission': {
  56 + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
  57 + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  58 + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
  59 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  60 + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  61 + },
  62 + u'contenttypes.contenttype': {
  63 + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  64 + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  65 + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  66 + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  67 + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  68 + }
  69 + }
  70 +
  71 + complete_apps = ['accounts']
0 \ No newline at end of file 72 \ No newline at end of file
src/accounts/models.py
@@ -20,6 +20,8 @@ class User(AbstractUser): @@ -20,6 +20,8 @@ class User(AbstractUser):
20 twitter = models.CharField(max_length=128, null=True, blank=True) 20 twitter = models.CharField(max_length=128, null=True, blank=True)
21 facebook = models.CharField(max_length=128, null=True, blank=True) 21 facebook = models.CharField(max_length=128, null=True, blank=True)
22 google_talk = models.EmailField(null=True, blank=True) 22 google_talk = models.EmailField(null=True, blank=True)
  23 + identi_ca = models.CharField(max_length=128, null=True, blank=True,
  24 + verbose_name=u'identi.ca')
23 webpage = models.CharField(max_length=256, null=True, blank=True) 25 webpage = models.CharField(max_length=256, null=True, blank=True)
24 verification_hash = models.CharField(max_length=32, null=True, blank=True) 26 verification_hash = models.CharField(max_length=32, null=True, blank=True)
25 modified = models.DateTimeField(auto_now=True) 27 modified = models.DateTimeField(auto_now=True)