Changes to siteindex layout
[archweb_dev-nj.git] / devel / models.py
blobd78989f586938f671abe22743cc9f733a70bbfb4
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 Meta:
14 db_table = 'common_mirror'
15 class Admin:
16 list_display = ('domain', 'country')
17 list_filter = ('country',)
18 ordering = ['domain']
19 search_fields = ('domain')
20 pass
22 class Donator(models.Model):
23 id = models.AutoField(primary_key=True)
24 name = models.CharField(maxlength=255)
25 def __str__(self):
26 return self.name
27 class Meta:
28 db_table = 'common_donator'
29 class Admin:
30 ordering = ['name']
31 search_fields = ('name')
32 pass
34 class UserProfile(models.Model):
35 id = models.AutoField(primary_key=True) # not technically needed
36 notify = models.BooleanField("Send notifications", default=True, help_text="When enabled, user will recieve 'flag out of date' notifications")
37 alias = models.CharField(core=True, maxlength=50, help_text="Required field")
38 public_email = models.CharField(core=True, maxlength=50, help_text="Required field")
39 other_contact = models.CharField(maxlength=100, null=True, blank=True)
40 website = models.URLField(null=True, blank=True)
41 yob = models.IntegerField(null=True, blank=True)
42 location = models.CharField(maxlength=50, null=True, blank=True)
43 languages = models.CharField(maxlength=50, null=True, blank=True)
44 interests = models.CharField(maxlength=255, null=True, blank=True)
45 occupation = models.CharField(maxlength=50, null=True, blank=True)
46 roles = models.CharField(maxlength=255, null=True, blank=True)
47 favorite_distros = models.CharField(maxlength=255, null=True, blank=True)
48 picture = models.FileField(upload_to='devs', default='devs/silhouette.png')
49 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)
50 class Meta:
51 db_table = 'user_profiles'
52 verbose_name = 'Additional Profile Data'
53 verbose_name_plural = 'Additional Profile Data'
55 # vim: set ts=4 sw=4 et: