mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-12 23:05:12 +00:00

Over the years, contributors come and go and we have many cases now where the contributor's email address which we have is not valid. As we really don't want to show incorrect information on the webpage, allow contributor email addresses to be blank for cases where we've discovered that the email address is no longer valid.
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
from django.db import models
|
|
from django.contrib.auth.models import User
|
|
|
|
class ContributorType(models.Model):
|
|
typename = models.CharField(max_length=32, null=False, blank=False)
|
|
sortorder = models.IntegerField(null=False, default=100)
|
|
extrainfo = models.TextField(null=True, blank=True)
|
|
detailed = models.BooleanField(null=False, default=True)
|
|
showemail = models.BooleanField(null=False, default=True)
|
|
|
|
purge_urls = ('/community/contributors/', )
|
|
|
|
def __unicode__(self):
|
|
return self.typename
|
|
|
|
class Meta:
|
|
ordering = ('sortorder',)
|
|
|
|
class Contributor(models.Model):
|
|
ctype = models.ForeignKey(ContributorType)
|
|
lastname = models.CharField(max_length=100, null=False, blank=False)
|
|
firstname = models.CharField(max_length=100, null=False, blank=False)
|
|
email = models.EmailField(null=False, blank=True)
|
|
company = models.CharField(max_length=100, null=True, blank=True)
|
|
companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL')
|
|
location = models.CharField(max_length=100, null=True, blank=True)
|
|
contribution = models.TextField(null=True, blank=True)
|
|
user = models.ForeignKey(User, null=True, blank=True)
|
|
|
|
send_notification=True
|
|
purge_urls = ('/community/contributors/', )
|
|
|
|
def __unicode__(self):
|
|
return "%s %s" % (self.firstname, self.lastname)
|
|
|
|
class Meta:
|
|
ordering = ('lastname', 'firstname',)
|