# Path: apps/account/models.py
# class Account(Model):
# 
#     # main data
#     user = ForeignKey('auth.User', unique=True, related_name="accounts")
#     description = TextField(blank=True)
#     source = CharField(max_length=64, choices=SOURCE_CHOICES, default='OTHER')
#     mobile = CharField(max_length=1024, blank=True)
#     links = ManyToManyField('link.Link', null=True, blank=True) 
#     passport = ProcessedImageField(upload_to=_upload_to, null=True, blank=True, 
#                                    processors=[ResizeToFit(1024, 768)],
#                                    format='JPEG', options={'quality': 90})
# 
#     # meta
#     # created_by = self
#     # updated_by = self
#     created_on = DateTimeField(auto_now_add=True)
#     updated_on = DateTimeField(auto_now=True)
# 
#     def get_name():
#         return self.user.username
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     class Meta:
# 
#         ordering = ['user__username']


from django.db.models import Model
from django.db.models import SlugField
from django.db.models import CharField
from django.db.models import BooleanField
from django.db.models import ManyToManyField
from django.db.models import ForeignKey
from django.db.models import DateTimeField
from django.db.models import TextField
from django.utils.translation import ugettext as _
from django_countries.fields import CountryField
from imagekit.models.fields import ProcessedImageField
from imagekit.processors import ResizeToFill
from apps.account.models import Account
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




STATUS_CHOICES = [
    ("PENDING", _("PENDING")),
    ("ACCEPTED", _("ACCEPTED")),
    ("DECLINED", _("DECLINED"))
]


def _upload_to(instance, filename, **kwargs):
    return "team/%s.%s" % (instance.link, 'png')


class Team(Model):

    link        = SlugField(unique=True) # team url name 
    links       = ManyToManyField('link.Link', null=True, blank=True) # team social media links
    name        = CharField(max_length=1024, unique=True)
    country     = CountryField()

# Path: apps/account/models.py
# class Account(Model):
# 
#     # main data
#     user = ForeignKey('auth.User', unique=True, related_name="accounts")
#     description = TextField(blank=True)
#     source = CharField(max_length=64, choices=SOURCE_CHOICES, default='OTHER')
#     mobile = CharField(max_length=1024, blank=True)
#     links = ManyToManyField('link.Link', null=True, blank=True) 
#     passport = ProcessedImageField(upload_to=_upload_to, null=True, blank=True, 
#                                    processors=[ResizeToFit(1024, 768)],
#                                    format='JPEG', options={'quality': 90})
# 
#     # meta
#     # created_by = self
#     # updated_by = self
#     created_on = DateTimeField(auto_now_add=True)
#     updated_on = DateTimeField(auto_now=True)
# 
#     def get_name():
#         return self.user.username
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     class Meta:
# 
#         ordering = ['user__username']


# Path: apps/team/models.py
from django.db.models import Model
from django.db.models import SlugField
from django.db.models import CharField
from django.db.models import BooleanField
from django.db.models import ManyToManyField
from django.db.models import ForeignKey
from django.db.models import DateTimeField
from django.db.models import TextField
from django.utils.translation import ugettext as _
from django_countries.fields import CountryField
from imagekit.models.fields import ProcessedImageField
from imagekit.processors import ResizeToFill
from apps.account.models import Account

# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




STATUS_CHOICES = [
    ("PENDING", _("PENDING")),
    ("ACCEPTED", _("ACCEPTED")),
    ("DECLINED", _("DECLINED"))
]


def _upload_to(instance, filename, **kwargs):
    return "team/%s.%s" % (instance.link, 'png')


class Team(Model):

    link        = SlugField(unique=True) # team url name 
    links       = ManyToManyField('link.Link', null=True, blank=True) # team social media links
    name        = CharField(max_length=1024, unique=True)
    country     = CountryField()

    members     = ManyToManyField(Account, null=True, blank=True, 