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)
14 list_display
= ('domain', 'country')
15 list_filter
= ('country',)
17 search_fields
= ('domain')
20 class Donator(models
.Model
):
21 id = models
.AutoField(primary_key
=True)
22 name
= models
.CharField(maxlength
=255)
27 search_fields
= ('name')
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)
47 db_table
= 'user_profiles'
48 verbose_name
= 'Additional Profile Data'
49 verbose_name_plural
= 'Additional Profile Data'