diff options
| author | tom christie tom@tomchristie.com | 2011-02-19 10:47:26 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-02-19 10:47:26 +0000 |
| commit | 57b3a372f2122d022f9d6f43818e5fe9d318ce03 (patch) | |
| tree | eb667e2de5681d1886d5119b5d4092b12cd24524 /examples/objectstore/views.py | |
| parent | 805aa03ec1871f6a766d9052b348ddce9e9843c3 (diff) | |
| download | django-rest-framework-57b3a372f2122d022f9d6f43818e5fe9d318ce03.tar.bz2 | |
Move status codes into seperate module
Diffstat (limited to 'examples/objectstore/views.py')
| -rw-r--r-- | examples/objectstore/views.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/objectstore/views.py b/examples/objectstore/views.py index b3ed5533..02b469db 100644 --- a/examples/objectstore/views.py +++ b/examples/objectstore/views.py @@ -2,7 +2,8 @@ from django.conf import settings from django.core.urlresolvers import reverse from djangorestframework.resource import Resource -from djangorestframework.response import Response, status +from djangorestframework.response import Response +from djangorestframework import status import pickle import os @@ -19,7 +20,7 @@ def remove_oldest_files(dir, max_files): filepaths = [os.path.join(dir, file) for file in os.listdir(dir)] ctime_sorted_paths = [item[0] for item in sorted([(path, os.path.getctime(path)) for path in filepaths], key=operator.itemgetter(1), reverse=True)] - [os.remove(path) for path in ctime_sorted_paths[max_files:]] + [os.remove(path) for path in ctime_sorted_paths[max_file:]] class ObjectStoreRoot(Resource): |
