Commit 784a388b authored by Tyler Hallada's avatar Tyler Hallada
Browse files

Removing caching. Removed unused imports.

parent c7eeb800
from django.db import models
from django.core.cache import cache
import datetime
......@@ -11,14 +10,6 @@ class Restaurant(models.Model):
specialSchedules = models.ManyToManyField('Schedule',
related_name='restaurant_special', null=True, blank=True)
def save(self, *args, **kwargs):
cache.clear() # Invalidate cache on restaurant change/creation
super(Restaurant, self).save(*args, **kwargs)
def delete(self, *args, **kwargs):
cache.clear() # Invalidate cache on restuarant deletion
super(Restaurant, self).delete(*args, **kwargs)
def isOpen(self):
"""
Return true if this restaurant is currently open.
......@@ -64,14 +55,6 @@ class Schedule(models.Model):
sunOpen = models.TimeField(null=True, blank=True)
sunClose = models.TimeField(null=True, blank=True)
def save(self, *args, **kwargs):
cache.clear() # Invalidate cache on schedule change/creation
super(Schedule, self).save(*args, **kwargs)
def delete(self, *args, **kwargs):
cache.clear() # Invalidate cache on schedule deletion
super(Schedule, self).delete(*args, **kwargs)
def isOpenNow(self):
"""Return true if this schedule is open right now."""
today = datetime.datetime.today()
......
from website.models import Restaurant, Schedule
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
from django.conf import settings
from website.models import Restaurant
from django.shortcuts import render_to_response
def restaurant_grid(request):
......
......@@ -23,14 +23,6 @@ DATABASES = {
}
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'TIMOUT': 259200,
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
......@@ -99,9 +91,6 @@ TEMPLATE_LOADERS = (
)
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment