--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-15 16:15
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-team', '0004_auto_20160715_1807'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='person',
+ name='nationality',
+ ),
+ ]
gender = models.CharField(_('gender'), max_length=16, choices=GENDER_CHOICES, blank=True)
first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
- birthday = models.DateField(_('birthday'), blank=True)
- nationality = NationalityField(_('nationality'), blank=True)
+ birthday = models.DateField(_('birthday'), blank=True, null=True)
bio = RichTextField(_('biography'), blank=True)
organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
verbose_name = _('person')
ordering = ['last_name',]
- def __unicode__(self):
- return ' '.join((self.user.first_name, self.user.last_name))
+ def __str__(self):
+ return ' '.join((self.first_name, self.last_name))
# def get_absolute_url(self):
# return reverse("festival-artist-detail", kwargs={'slug': self.slug})
from django.db.models.fields import CharField
-
class Nationality(object):
"""
Class represents a nationality.
self.code = code
def __unicode__(self):
- return self.code or ''
+ return str(self.code or '')
def __eq__(self, other):
- return self.code == other
+ return self.code == str(other)
def __ne__(self, other):
return not self.__eq__(other)
def __cmp__(self, other):
- return cmp(self.code, other)
+ return cmp(self.code, str(other))
def __hash__(self):
return hash(self.code)
return Nationality(code=instance.__dict__[self.field.name])
def __set__(self, instance, value):
- instance.__dict__[self.field.name] = value
+ instance.__dict__[self.field.name] = str(value)
class NationalityField(CharField):
# Convert the Nationality to unicode for database insertion.
if value is None:
return None
- return value
+ return str(value)
# If south is installed, ensure that NationalityField will be introspected just