# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """ We iterate over all the financials in the system, and for each financial we create two Company-contacts for its billing and billed organizaitons respectively. Those contacts are created in the organization where their financial is located (we can figure out in which organization a financial is located through its containing matter, sub matter or event). Users from the billing and billed organizations are then added to their respective Company-contacts as Person-contacts. """ import functools from collections import defaultdict org_ct = orm['contenttypes.ContentType'].objects.get(app_label='organizations', model='organization') def get_node(obj, content_type): return orm['acl.AclNode'].objects.get(object_id=obj.pk, content_type=content_type) addr_fields = ('street_address', 'city', 'postal_code', 'region', 'country') contact_fields = ('first_name', 'last_name', 'cellphone_number', 'fax_number', 'legal_entity_name', 'phone_number', 'position') def get_fields(obj_fields, obj): fields = {} for field in obj_fields: fields[field] = getattr(obj, field) return fields get_person_fields = lambda user: functools.partial(get_fields, addr_fields + contact_fields)(user) get_company_fields = lambda company: functools.partial(get_fields, addr_fields)(company) def create_company(source_org, financial_org): return orm['contacts.Contact'].objects.create(organization=financial_org, legal_entity_name=source_org.title, type='Company', **get_company_fields(source_org)) def create_person(user, company): return orm['contacts.Contact'].objects.create(organization=company.organization, type='Person', company=company, **get_person_fields(user)) get_org_users = lambda org: map(lambda c: c.user, get_node(org, org_ct).cache.all()) org_companies = defaultdict(dict) org_companies_persons = defaultdict(dict) for financial in orm.Financial.objects.all(): financial_org_pk = financial.project.get_root().object_id financial_org = orm['organizations.Organization'].objects.get(pk=financial_org_pk) billing_org, billed_org = financial.billing_organization, financial.billed_organization # billing and billed organizations may be the same object orgs = [billing_org] if billing_org != billed_org: orgs.append(billed_org) for i, org in enumerate(orgs): if org.pk not in org_companies[financial_org_pk]: # create Company-contact for the organization company = org_companies[financial_org_pk][org.pk] = create_company(org, financial_org) org_companies_persons[financial_org_pk][org.pk] = [] for user in get_org_users(org): # create Person-contacts for all the users from the organization from the enclosing loop person = create_person(user, company) if i == 0: org_companies_persons[financial_org_pk][org.pk].append((user, person)) billing_company, billed_company = (org_companies[financial_org_pk][billing_org.pk], org_companies[financial_org_pk][billed_org.pk]) financial.billing_organization_temp = billing_company financial.billed_organization_temp = billed_company # retreiving the contact created for the user from the current financial transaction_persons = filter(lambda u: u[0] == financial.contact, org_companies_persons[financial_org_pk][billing_org.pk]) if len(transaction_persons) == 0: transaction_person = create_person(financial.contact, billing_company) else: transaction_person = transaction_persons[0][1] financial.contact_temp = transaction_person financial.save() def backwards(self, orm): "Write your backwards methods here." models = { u'acl.aclnode': { 'Meta': {'unique_together': "(('object_id', 'content_type'),)", 'object_name': 'AclNode'}, 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), u'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), 'node_type': ('model_utils.fields.StatusField', [], {'default': "'inherit'", 'max_length': '100', u'no_check_for_status': 'True'}), 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), 'parent': ('mptt.fields.TreeForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': u"orm['acl.AclNode']"}), u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) }, u'acl.aclnodecache': { 'Meta': {'unique_together': "(('node', 'user', 'role'),)", 'object_name': 'AclNodeCache'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'cache'", 'to': u"orm['acl.AclNode']"}), 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Role']"}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.User']"}) }, u'acl.aclnoderecord': { 'Meta': {'unique_together': "(('node', 'content_type', 'object_id'),)", 'object_name': 'AclNodeRecord'}, 'access_type': ('django.db.models.fields.CharField', [], {'default': "'a'", 'max_length': '1'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'records'", 'to': u"orm['acl.AclNode']"}), 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Role']", 'null': 'True', 'blank': 'True'}) }, u'acl.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'acl_groups'", 'symmetrical': 'False', 'to': u"orm['users.User']"}) }, u'acl.permission': { 'Meta': {'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'depends_on': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['acl.Permission']", 'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) }, u'acl.role': { 'Meta': {'object_name': 'Role'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_system': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['acl.Permission']", 'symmetrical': 'False'}) }, u'auth.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, u'auth.permission': { 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, u'contacts.contact': { 'Meta': {'object_name': 'Contact'}, 'cellphone_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'company': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'to': u"orm['contacts.Contact']"}), 'country': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['preferences.Country']"}), 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'fax_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'legal_entity_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'organization': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['organizations.Organization']"}), 'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'position': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'street_address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'to_user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.User']", 'null': 'True', 'blank': 'True'}), 'type': ('model_utils.fields.StatusField', [], {'default': "'Person'", 'max_length': '100', u'no_check_for_status': 'True'}) }, u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, u'financials.currency': { 'Meta': {'ordering': "('organization', 'weight')", 'object_name': 'Currency'}, 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['organizations.Organization']"}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'financials.financial': { 'Meta': {'object_name': 'Financial'}, 'billed_organization': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'received_bills'", 'to': u"orm['organizations.Organization']"}), 'billed_organization_temp': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'received_bills'", 'null': 'True', 'to': u"orm['contacts.Contact']"}), 'billing_organization': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'issued_bills'", 'to': u"orm['organizations.Organization']"}), 'billing_organization_temp': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'issued_bills'", 'null': 'True', 'to': u"orm['contacts.Contact']"}), 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['users.User']"}), 'contact_temp': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contacts.Contact']", 'null': 'True', 'blank': 'True'}), 'currency': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['financials.Currency']"}), 'date': ('django.db.models.fields.DateField', [], {}), 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'discount': ('django.db.models.fields.FloatField', [], {}), 'hourly_rate': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), 'hours': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'minutes': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), 'price': ('django.db.models.fields.FloatField', [], {}), 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pekama.Project']"}), 'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), 'status': ('django.db.models.fields.CharField', [], {'max_length': '20'}), 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['financials.TransactionType']"}), 'vat': ('django.db.models.fields.FloatField', [], {}) }, u'financials.transactiontype': { 'Meta': {'ordering': "('organization', 'weight')", 'object_name': 'TransactionType'}, 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['organizations.Organization']"}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'legal.mattertype': { 'Meta': {'object_name': 'MatterType'}, 'classification_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'classification_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'code': ('django.db.models.fields.CharField', [], {'max_length': '3'}), 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), 'defining_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'defining_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'matter_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'matter_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), 'sub_matter_sub_type_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'sub_matter_sub_type_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'sub_matter_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'sub_matter_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'sub_matter_type_title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'sub_matter_type_title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), 'title_verbose': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, u'organizations.organization': { 'Meta': {'object_name': 'Organization'}, 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'code': ('django.db.models.fields.CharField', [], {'max_length': '4'}), 'country': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['preferences.Country']"}), 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), 'email_local_part': ('autoslug.fields.AutoSlugField', [], {'unique': 'True', 'max_length': '64', 'populate_from': "'title'", 'unique_with': '()'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'organizations_owned'", 'to': u"orm['users.User']"}), 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'rel_to_creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'organizations'", 'null': 'True', 'to': u"orm['organizations.OrganizationRelationship']"}), 'street_address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'organizations'", 'null': 'True', 'to': u"orm['organizations.OrganizationType']"}) }, u'organizations.organizationrelationship': { 'Meta': {'ordering': "('organization', 'weight')", 'object_name': 'OrganizationRelationship'}, 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['organizations.Organization']"}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'organizations.organizationtype': { 'Meta': {'ordering': "('organization', 'weight')", 'object_name': 'OrganizationType'}, 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['organizations.Organization']"}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'pekama.project': { 'Meta': {'unique_together': "(('object_id', 'content_type'),)", 'object_name': 'Project', '_bases': ('mptt.models.MPTTModel',)}, 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_ref_no_manual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), u'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), # 'matter_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['legal.MatterType']", 'null': 'True', 'blank': 'True'}), 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), 'parent': ('mptt.fields.TreeForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': u"orm['pekama.Project']"}), 'ref_no': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) }, u'preferences.country': { 'Meta': {'ordering': "('organization', 'weight', 'value')", 'object_name': 'Country'}, 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '2'}), 'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), # 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}), # 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['organizations.Organization']"}), 'phone_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'weight': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'users.user': { 'Meta': {'object_name': 'User'}, 'cellphone_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'confirmation_code': ('django.db.models.fields.CharField', [], {'max_length': '36', 'null': 'True'}), 'country': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': u"orm['preferences.Country']"}), 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75'}), 'fax_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'legal_entity_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'pass_restoration_code': ('django.db.models.fields.CharField', [], {'max_length': '36', 'null': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'position': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}), 'region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'street_address': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), 'two_factor': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'two_factor_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), 'two_factor_phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), 'type': ('model_utils.fields.StatusField', [], {'default': "'Person'", 'max_length': '100', u'no_check_for_status': 'True'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}) } } complete_apps = ['acl', 'financials'] symmetrical = True