Added hacking doc.
[archweb_dev-nj.git] / common / models.py
blob883675b63e528b4d0e79e6228ade3812c24b971a
1 from django.db import models
2 from django.contrib.auth.models import User
4 class Mirror(models.Model):
5 id = models.AutoField(primary_key=True)
6 domain = models.CharField(maxlength=255)
7 country = models.CharField(maxlength=255)
8 url = models.CharField(maxlength=255)
9 protocol_list = models.CharField(maxlength=255, null=True, blank=True)
10 admin_email = models.CharField(maxlength=255, null=True, blank=True)
11 def __str__(self):
12 return self.domain
13 class Admin:
14 list_display = ('domain', 'country')
15 list_filter = ('country',)
16 ordering = ['domain']
17 search_fields = ('domain')
18 pass
20 class Donator(models.Model):
21 id = models.AutoField(primary_key=True)
22 name = models.CharField(maxlength=255)
23 def __str__(self):
24 return self.name
25 class Admin:
26 ordering = ['name']
27 search_fields = ('name')
28 pass
30 class UserProfile(models.Model):
31 id = models.AutoField(primary_key=True) # not technically needed
32 notify = models.BooleanField("Send notifications", default=True, help_text="When enabled, user will recieve 'flag out of date' notifications")
33 alias = models.CharField(core=True, maxlength=50, help_text="Required field")
34 public_email = models.CharField(core=True, maxlength=50, help_text="Required field")
35 other_contact = models.CharField(maxlength=100, null=True, blank=True)
36 website = models.URLField(null=True, blank=True)
37 yob = models.IntegerField(null=True, blank=True)
38 location = models.CharField(maxlength=50, null=True, blank=True)
39 languages = models.CharField(maxlength=50, null=True, blank=True)
40 interests = models.CharField(maxlength=255, null=True, blank=True)
41 occupation = models.CharField(maxlength=50, null=True, blank=True)
42 roles = models.CharField(maxlength=255, null=True, blank=True)
43 favorite_distros = models.CharField(maxlength=255, null=True, blank=True)
44 picture = models.FileField(upload_to='devs', default='devs/silhouette.png')
45 user = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=1, min_num_in_admin=1, max_num_in_admin=1, num_extra_on_change=0, unique=True)
46 class Meta:
47 db_table = 'user_profiles'
48 verbose_name = 'Additional Profile Data'
49 verbose_name_plural = 'Additional Profile Data'