# Path: zipfelchappe/models.py
# CURRENCY_CHOICES = list(((cur, cur) for cur in CURRENCIES))
#     FAILED = 0
#     UNAUTHORIZED = 10
#     AUTHORIZED = 20
#     PROCESSING = 25
#     PAID = 30
#     STATUS_CHOICES = (
#         (UNAUTHORIZED, _('Unauthorized')),
#         (AUTHORIZED, _('Authorized')),
#         (PAID, _('Paid')),
#         (PROCESSING, _('Processing...')),
#         (FAILED, _('Failed')),
#     )
#     STATUS_DRAFT = 'draft'
#     STATUS_PUBLISHED = 'published'
#     STATUS_CHOICES = (
#         (STATUS_DRAFT, _('Draft')),
#         (STATUS_PUBLISHED, _('Published')),
#     )
#     ACTION_THANKYOU = 'thankyou'
#     ACTION_CHOICES = (
#         (ACTION_THANKYOU, _('Thank you')),
#     )
#     FIELD_TYPES = [
#         ('text', _('text'), forms.CharField),
#         ('email', _('e-mail address'), forms.EmailField),
#         ('longtext', _('long text'),
#          curry(forms.CharField, widget=forms.Textarea)),
#         ('checkbox', _('checkbox'), curry(forms.BooleanField, required=False)),
#         ('select', _('select'), curry(forms.ChoiceField, required=False)),
#     ]
# class TranslatedMixin(object):
# class Backer(models.Model):
#     class Meta:
# class Pledge(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class Reward(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class Category(CreateUpdateModel):
#     class Meta:
# class Update(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class MailTemplate(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class ExtraField(models.Model):
#     class Meta:
# class ProjectManager(models.Manager):
# class Project(Base, TranslatedMixin):
#     class Meta:
#     def translated(self):
#     def __unicode__(self):
#     def email(self):
#     def first_name(self):
#     def last_name(self):
#     def full_name(self):
#     def get_profile(self):
#     def __init__(self, *args, **kwargs):
#     def __unicode__(self):
#     def save(self, *args, **kwargs):
#     def set_backer(self, backer):
#     def add_details(self, details):
#     def mark_failed(self, message=None):
#     def amount_display(self):
#     def backer_name(self):
#     def export_related(self):
#     def __unicode__(self):
#     def clean(self):
#     def reserved(self):
#     def awarded(self):
#     def available(self):
#     def is_available(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def project_count(self):
# def update_upload_to(instance, filename):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def number(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clean(self):
#     def get_choices(self):
#     def get_type(self, **kwargs):
#     def add_formfield(self, fields, form):
#     def formfield(self):
#     def get_queryset(self):
#     def online(self):
#     def funding(self):
#     def billable(self):
# def teaser_img_upload_to(instance, filename):
#     def __init__(self, *args, **kwargs):
#     def save(self, *args, **kwargs):
#     def __unicode__(self):
#     def clean(self):
#     def get_absolute_url(self):
#     def create_content_type(cls, model, *args, **kwargs):
#     def register_regions(cls, *args, **kwargs):
#     def authorized_pledges(self):
#     def collectable_pledges(self):
#     def has_pledges(self):
#     def achieved(self):
#     def percent(self):
#     def goal_display(self):  # TODO: localize
#     def achieved_display(self):
#     def is_active(self):
#     def is_over(self):
#     def less_than_24_hours(self):
#     def is_financed(self):
#     def ended_successfully(self):
#     def update_count(self):
#     def public_pledges(self):
#     def poster_image(self):
#     def extraform(self):


import datetime
from dateutil import relativedelta
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from zipfelchappe.models import BackerBase



class ExtendedBacker(BackerBase):

    GENDER_CHOICES = (
        ('m', _('Male')),
        ('f', _('Female')),
    )

    gender = models.CharField(_('gender'), choices=GENDER_CHOICES, max_length=1)

    #birth_date = models.DateField(_('birth date'), blank=True, null=True)

    address = models.CharField(_('address'), max_length=100)
    city = models.CharField(_('city'), max_length=100)
    state = models.CharField(_('state'), max_length=100)
    zip = models.CharField(_('zip'), max_length=10)
    country = models.CharField(_('country'), max_length=100)

    class Meta:
        verbose_name = _('backer')
        verbose_name_plural = _('backer')

    @property
    def age(self):
        TODAY = datetime.date.today()
        if self.birth_date:
            return u"%s" % relativedelta.relativedelta(TODAY, self.birth_date).years
        else:

# Path: zipfelchappe/models.py
# CURRENCY_CHOICES = list(((cur, cur) for cur in CURRENCIES))
#     FAILED = 0
#     UNAUTHORIZED = 10
#     AUTHORIZED = 20
#     PROCESSING = 25
#     PAID = 30
#     STATUS_CHOICES = (
#         (UNAUTHORIZED, _('Unauthorized')),
#         (AUTHORIZED, _('Authorized')),
#         (PAID, _('Paid')),
#         (PROCESSING, _('Processing...')),
#         (FAILED, _('Failed')),
#     )
#     STATUS_DRAFT = 'draft'
#     STATUS_PUBLISHED = 'published'
#     STATUS_CHOICES = (
#         (STATUS_DRAFT, _('Draft')),
#         (STATUS_PUBLISHED, _('Published')),
#     )
#     ACTION_THANKYOU = 'thankyou'
#     ACTION_CHOICES = (
#         (ACTION_THANKYOU, _('Thank you')),
#     )
#     FIELD_TYPES = [
#         ('text', _('text'), forms.CharField),
#         ('email', _('e-mail address'), forms.EmailField),
#         ('longtext', _('long text'),
#          curry(forms.CharField, widget=forms.Textarea)),
#         ('checkbox', _('checkbox'), curry(forms.BooleanField, required=False)),
#         ('select', _('select'), curry(forms.ChoiceField, required=False)),
#     ]
# class TranslatedMixin(object):
# class Backer(models.Model):
#     class Meta:
# class Pledge(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class Reward(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class Category(CreateUpdateModel):
#     class Meta:
# class Update(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class MailTemplate(CreateUpdateModel, TranslatedMixin):
#     class Meta:
# class ExtraField(models.Model):
#     class Meta:
# class ProjectManager(models.Manager):
# class Project(Base, TranslatedMixin):
#     class Meta:
#     def translated(self):
#     def __unicode__(self):
#     def email(self):
#     def first_name(self):
#     def last_name(self):
#     def full_name(self):
#     def get_profile(self):
#     def __init__(self, *args, **kwargs):
#     def __unicode__(self):
#     def save(self, *args, **kwargs):
#     def set_backer(self, backer):
#     def add_details(self, details):
#     def mark_failed(self, message=None):
#     def amount_display(self):
#     def backer_name(self):
#     def export_related(self):
#     def __unicode__(self):
#     def clean(self):
#     def reserved(self):
#     def awarded(self):
#     def available(self):
#     def is_available(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def project_count(self):
# def update_upload_to(instance, filename):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def number(self):
#     def __unicode__(self):
#     def __unicode__(self):
#     def clean(self):
#     def get_choices(self):
#     def get_type(self, **kwargs):
#     def add_formfield(self, fields, form):
#     def formfield(self):
#     def get_queryset(self):
#     def online(self):
#     def funding(self):
#     def billable(self):
# def teaser_img_upload_to(instance, filename):
#     def __init__(self, *args, **kwargs):
#     def save(self, *args, **kwargs):
#     def __unicode__(self):
#     def clean(self):
#     def get_absolute_url(self):
#     def create_content_type(cls, model, *args, **kwargs):
#     def register_regions(cls, *args, **kwargs):
#     def authorized_pledges(self):
#     def collectable_pledges(self):
#     def has_pledges(self):
#     def achieved(self):
#     def percent(self):
#     def goal_display(self):  # TODO: localize
#     def achieved_display(self):
#     def is_active(self):
#     def is_over(self):
#     def less_than_24_hours(self):
#     def is_financed(self):
#     def ended_successfully(self):
#     def update_count(self):
#     def public_pledges(self):
#     def poster_image(self):
#     def extraform(self):


# Path: example/backers/models.py
import datetime
from dateutil import relativedelta
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from zipfelchappe.models import BackerBase




class ExtendedBacker(BackerBase):

    GENDER_CHOICES = (
        ('m', _('Male')),
        ('f', _('Female')),
    )

    gender = models.CharField(_('gender'), choices=GENDER_CHOICES, max_length=1)

    #birth_date = models.DateField(_('birth date'), blank=True, null=True)

    address = models.CharField(_('address'), max_length=100)
    city = models.CharField(_('city'), max_length=100)
    state = models.CharField(_('state'), max_length=100)
    zip = models.CharField(_('zip'), max_length=10)
    country = models.CharField(_('country'), max_length=100)

    class Meta:
        verbose_name = _('backer')
        verbose_name_plural = _('backer')

    @property
    def age(self):
        TODAY = datetime.date.today()
        if self.birth_date:
            return u"%s" % relativedelta.relativedelta(TODAY, self.birth_date).years
        else:

            return None