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

We were already using signals for everything except delete, and even in our old version of django the delete signal exists (it didn't exist when this code was first written). Django doesn't really like models to be OOP like this, so keeping PgModel would cause issues with upcoming changes in django 1.8. Using simple functions is easier, and the actual functionality is replicated straight off.
19 lines
794 B
Python
19 lines
794 B
Python
from django.db import models
|
|
|
|
class PUG(models.Model):
|
|
"""
|
|
contains information about a local PostgreSQL user group
|
|
"""
|
|
country = models.ForeignKey('core.Country')
|
|
org = models.ForeignKey('core.Organisation', null=True, blank=True, help_text='Organization that manages the PUG and its contents')
|
|
approved = models.BooleanField(null=False, blank=False, default=False)
|
|
locale = models.CharField(max_length=255, help_text="Locale where the PUG meets, e.g. 'New York City'")
|
|
title = models.CharField(max_length=255, help_text="Title/Name of the PUG, e.g. 'NYC PostgreSQL User Group'")
|
|
website_url = models.TextField(null=True, blank=True)
|
|
mailing_list_url = models.TextField(null=True, blank=True)
|
|
|
|
purge_urls = ('/community/user-groups/', )
|
|
|
|
def __unicode__(self):
|
|
return self.title
|