# Path: categories/models.py
# class Category(models.Model):
#     name = models.CharField(max_length=30)
#     active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
# Path: races/models.py
# class Race(models.Model):
# 
#     name = models.CharField(max_length=40)
#     active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name


from django.db import models
from django.contrib.auth.models import User
from categories.models import Category
from races.models import Race

class SavedSearch(models.Model):
    user = models.ForeignKey(User)
    keywords = models.CharField(max_length=80)
    longitude = models.FloatField(null=True)
    latitude = models.FloatField(null=True)

# Path: categories/models.py
# class Category(models.Model):
#     name = models.CharField(max_length=30)
#     active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name
# 
# Path: races/models.py
# class Race(models.Model):
# 
#     name = models.CharField(max_length=40)
#     active = models.BooleanField(default=True)
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def __str__(self):
#         return self.name


# Path: saveserches/models.py
from django.db import models
from django.contrib.auth.models import User
from categories.models import Category
from races.models import Race


class SavedSearch(models.Model):
    user = models.ForeignKey(User)
    keywords = models.CharField(max_length=80)
    longitude = models.FloatField(null=True)
    latitude = models.FloatField(null=True)

    category = models.ForeignKey(Category)