Commit ca0e8abf by Piotr Mitros

Merge pull request #3 from edx/ned/update-django-18

Minor cleanups for Django 1.8
parents d175715e c94e3f4e
...@@ -55,21 +55,13 @@ class FSExpirations(models.Model): ...@@ -55,21 +55,13 @@ class FSExpirations(models.Model):
return cls.objects.filter(expires=True, expiration__lte = expiration_lte) return cls.objects.filter(expires=True, expiration__lte = expiration_lte)
class Meta: class Meta:
app_label = 'djpyfs'
unique_together = (("module","filename")) unique_together = (("module","filename"))
## FIXME: We'd like to create an index first on expiration than on expires (so we can # We'd like to create an index first on expiration than on expires (so we can
## search for objects where expires=True and expiration is before now). Django 1.5 # search for objects where expires=True and expiration is before now).
## supports this, but 1.4 does not. index_together = [
## ["expiration", "expires"],
## I'm putting this in in preparation for 1.5. This is ]
## slightly redundant, since documentation is unclear about
## order of the joint index.
##
## When 1.5 comes out, we can drop the index on expiration.
if django.get_version()>='1.5':
index_together = [
["expires","expiration"],
["expiration","expires"]
]
def __str__(self): def __str__(self):
if self.expires: if self.expires:
......
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
# Create your views here.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from distutils.core import setup from distutils.core import setup
setup(name='django-pyfs', setup(name='django-pyfs',
version='1.0', version='1.0.3',
description='Django pyfilesystem integration', description='Django pyfilesystem integration',
author='Piotr Mitros', author='Piotr Mitros',
author_email='pmitros@edx.org', author_email='pmitros@edx.org',
......
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