# Path: apps/members/models.py
# class Member(models.Model):
#     name = models.CharField(max_length=100)
#     nickname = models.CharField(max_length=100, null=True, blank=True)
#     phone = models.CharField(max_length=13, null=True, blank=True)
#     currently_does = models.TextField()
#     life_and_work = models.TextField()
#     function = models.CharField(max_length=100, choices=MEMBER_FUNCTIONS)
#     site = models.URLField(null=True, blank=True)
#     github = models.CharField(max_length=50, null=True, blank=True)
#     twitter = models.CharField(max_length=50, null=True, blank=True)
#     slideshare = models.CharField(max_length=50, null=True, blank=True)
#     lattes = models.URLField(null=True, blank=True)
#     photo = ImageWithThumbsField(upload_to='images/members', sizes=((100, 100), ))
#     started_nsi_date = models.DateField()
#     desertion_nsi_date = models.DateField(null=True, blank=True)
#     is_renegade = models.BooleanField(editable=False)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def github_link(self):
#         return "http://github.com/" + self.github
# 
#     def twitter_link(self):
#         return "http://twitter.com/" + self.twitter
# 
#     def slideshare_link(self):
#         return "http://www.slideshare.net/" + self.slideshare
# 
#     def github_feed(self):
#         return self.github_link() + '.atom'
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         if self.desertion_nsi_date is not None:
#             self.is_renegade = True
#             super(Member, self).save(*args, **kwargs)
#         else:
#             self.is_renegade = False
#             super(Member, self).save(*args, **kwargs)
# 
# Path: apps/members/models.py
# class Participation(models.Model):
#     member = models.ForeignKey('Member')
#     project = models.ForeignKey(Project)
#     start_date = models.DateField()
#     end_date = models.DateField(null=True, blank=True)
# 
#     def __unicode__(self):
#         return self.member.name + ' - ' + self.project.name


from django.contrib import admin
from apps.members.models import Member
from apps.members.models import Participation


class ParticipationInline(admin.TabularInline):
    model = Participation
    extra = 1

class MemberAdmin(admin.ModelAdmin):
    list_display = ('name', 'function', 'site','github', 'twitter','slideshare','lattes','phone','started_nsi_date', 'is_renegade')
    list_filter = ('function','started_nsi_date','is_renegade')
    inlines = [ParticipationInline]



# Path: apps/members/models.py
# class Member(models.Model):
#     name = models.CharField(max_length=100)
#     nickname = models.CharField(max_length=100, null=True, blank=True)
#     phone = models.CharField(max_length=13, null=True, blank=True)
#     currently_does = models.TextField()
#     life_and_work = models.TextField()
#     function = models.CharField(max_length=100, choices=MEMBER_FUNCTIONS)
#     site = models.URLField(null=True, blank=True)
#     github = models.CharField(max_length=50, null=True, blank=True)
#     twitter = models.CharField(max_length=50, null=True, blank=True)
#     slideshare = models.CharField(max_length=50, null=True, blank=True)
#     lattes = models.URLField(null=True, blank=True)
#     photo = ImageWithThumbsField(upload_to='images/members', sizes=((100, 100), ))
#     started_nsi_date = models.DateField()
#     desertion_nsi_date = models.DateField(null=True, blank=True)
#     is_renegade = models.BooleanField(editable=False)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def github_link(self):
#         return "http://github.com/" + self.github
# 
#     def twitter_link(self):
#         return "http://twitter.com/" + self.twitter
# 
#     def slideshare_link(self):
#         return "http://www.slideshare.net/" + self.slideshare
# 
#     def github_feed(self):
#         return self.github_link() + '.atom'
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         if self.desertion_nsi_date is not None:
#             self.is_renegade = True
#             super(Member, self).save(*args, **kwargs)
#         else:
#             self.is_renegade = False
#             super(Member, self).save(*args, **kwargs)
# 
# Path: apps/members/models.py
# class Participation(models.Model):
#     member = models.ForeignKey('Member')
#     project = models.ForeignKey(Project)
#     start_date = models.DateField()
#     end_date = models.DateField(null=True, blank=True)
# 
#     def __unicode__(self):
#         return self.member.name + ' - ' + self.project.name


# Path: apps/members/admin.py
from django.contrib import admin
from apps.members.models import Member
from apps.members.models import Participation



class ParticipationInline(admin.TabularInline):
    model = Participation
    extra = 1

class MemberAdmin(admin.ModelAdmin):
    list_display = ('name', 'function', 'site','github', 'twitter','slideshare','lattes','phone','started_nsi_date', 'is_renegade')
    list_filter = ('function','started_nsi_date','is_renegade')
    inlines = [ParticipationInline]



admin.site.register(Member, MemberAdmin)