JourneyJoker/partners/models.py

24 lines
No EOL
804 B
Python

from django.contrib.gis.db import models
from localauth.models import User, Profile
from django_countries.fields import CountryField
class PartnerProfile(Profile):
pass
class Establishment(models.Model):
owner = models.ForeignKey(PartnerProfile, models.CASCADE)
name = models.CharField(max_length=64)
stars = models.IntegerField(null=True, blank=True)
street = models.CharField(max_length=64)
city = models.CharField(max_length=64)
zip = models.CharField(max_length=16)
state = models.CharField(max_length=64)
country = CountryField()
coords = models.PointField()
verified = models.BooleanField(default=False)
class RoomCategory(models.Model):
establishment = models.ForeignKey(Establishment, models.CASCADE)
name = models.CharField(max_length=64)