Skip to content

Instantly share code, notes, and snippets.

@ijharulislam
Last active January 12, 2016 06:08
Show Gist options
  • Save ijharulislam/e71a4cff0c40aa4a8c48 to your computer and use it in GitHub Desktop.
Save ijharulislam/e71a4cff0c40aa4a8c48 to your computer and use it in GitHub Desktop.
from django.db import models
from location.models import Location
from django.contrib.auth.models import User
# Create your models here.
PROVINCE_CHOICES = (
('1','Select Province'),
('2','AB'),
('3','BC'),
('4','MB'),
('5','NB'),
('6','NL'),
('7','NT'),
('8','NS'),
('9','NU'),
('10','ON'),
('11','QC'),
('12','SK'),
('13','YT'),
)
class Agency(models.Model):
approved = models.BooleanField(default=False)
name = models.CharField(max_length=200)
lat = models.FloatField(default=0.0)
lon = models.FloatField(default=0.0)
phone = models.CharField(max_length=100,blank=True,null=True)
toll_free_phone = models.CharField(max_length=100,blank=True,null=True)
crisis_phone = models.CharField(max_length=100,blank=True,null=True)
fax = models.CharField(max_length=150,blank=True,null=True)
email = models.EmailField(max_length=150,blank=True,null=True)
website = models.CharField(max_length=150,null=True,blank=True)
street_address = models.CharField(max_length=250,blank=True,null=True)
city = models.CharField(max_length=250,blank=True,null=True)
province = models.CharField(max_length=200,choices=PROVINCE_CHOICES, null=True, blank=True)
postal_code = models.CharField(max_length=40)
address_location = models.CharField(max_length=250,blank=True,null=True)
mail_address = models.CharField(max_length=250, blank=True,null=True)
fees = models.CharField(max_length=150,blank=True,null=True)
hours = models.CharField(max_length=150,blank=True,null=True)
last_modified = models.DateTimeField()
language_of_service = models.CharField(max_length=300,blank=True,null=True)
organization_type = models.CharField(max_length=300,blank=True,null=True)
eligibility = models.CharField(max_length=200,blank=True,null=True)
how_to_apply = models.TextField(max_length=500,blank=True,null=True)
physical_access = models.CharField(max_length=300,blank=True,null=True)
service_description = models.TextField(max_length=2000,blank=True,null=True)
contact = models.TextField(max_length=500,blank=True,null=True)
about = models.TextField(max_length=1000,blank=True,null=True)
cover_image = models.ImageField(upload_to="media", blank=True, null=True)
logo = models.ImageField(upload_to="media", blank=True, null=True)
fb_url = models.TextField(validators=[URLValidator()])
twitter= models.TextField(validators=[URLValidator()])
google_plus= models.TextField(validators=[URLValidator()])
linkedin = models.TextField(validators=[URLValidator()])
created_on = models.DateTimeField(auto_now_add=True, null=True,blank=True)
modified_on = models.DateTimeField(auto_now=True,null=True,blank=True)
created_by = models.ForeignKey(User, related_name="agency_created_by", null=True,blank=True)
modified_by = models.ForeignKey(User, related_name="agency_modified_by", null=True,blank=True)
class Meta:
verbose_name_plural = 'Agencies'
class Email_list(models.Model):
agency = models.ForeignKey(Agency, null=True, blank=True)
email = models.EmailField(max_length=100, null=True, blank=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment