Changeset 215:307f33589e18
- Timestamp:
- 13/10/10 13:12:54 (3 years ago)
- Branch:
- default
- Files:
-
- 5 added
- 5 deleted
- 10 edited
-
.hgignore (modified) (1 diff)
-
cyclope/apps/articles/admin.py (modified) (1 diff)
-
cyclope/apps/articles/models.py (modified) (2 diffs)
-
cyclope/apps/medialibrary/models.py (modified) (2 diffs)
-
cyclope/core/collections/frontend_views.py (modified) (2 diffs)
-
cyclope/feeds.py (modified) (3 diffs)
-
cyclope/migrations/0009_move_image_data_to_picture.py (modified) (1 diff)
-
cyclope/models.py (modified) (2 diffs)
-
cyclope/tests.py (modified) (4 diffs)
-
demo/cyclope_project/cyclope_project_index/_MAIN_301.dci (added)
-
demo/cyclope_project/cyclope_project_index/_MAIN_301.dcz (added)
-
demo/cyclope_project/cyclope_project_index/_MAIN_301.pst (added)
-
demo/cyclope_project/cyclope_project_index/_MAIN_301.tiz (added)
-
demo/cyclope_project/cyclope_project_index/_MAIN_302.toc (added)
-
demo/cyclope_project/cyclope_project_index/_MAIN_48.dci (deleted)
-
demo/cyclope_project/cyclope_project_index/_MAIN_48.dcz (deleted)
-
demo/cyclope_project/cyclope_project_index/_MAIN_48.pst (deleted)
-
demo/cyclope_project/cyclope_project_index/_MAIN_48.tiz (deleted)
-
demo/cyclope_project/cyclope_project_index/_MAIN_49.toc (deleted)
-
demo/cyclope_project/db/site.db (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
.hgignore
r188 r215 19 19 django_cyclope.egg-info 20 20 fulldb.json 21 .emacs.desktop -
cyclope/apps/articles/admin.py
r211 r215 64 64 'classes': ('collapse',), 65 65 'fields':('source', 'tags', 'pretitle', 66 'summary', 'date', 'allow_comments' )}),66 'summary', 'date', 'allow_comments', 'creation_date')}), 67 67 ) 68 68 -
cyclope/apps/articles/models.py
r206 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 61 61 verbose_name = _('article') 62 62 verbose_name_plural = _('articles') 63 ordering = ('- modification_date', 'name')63 ordering = ('-creation_date', 'name') 64 64 -
cyclope/apps/medialibrary/models.py
r144 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 39 39 class Meta: 40 40 abstract = True 41 ordering = ('-creation_date', 'name') 41 42 42 43 -
cyclope/core/collections/frontend_views.py
r207 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 68 68 def get_string_response(self, request, content_object=None, *args, **kwargs): 69 69 category = content_object 70 c = RequestContext(request, 71 {'categorizations': category.categorizations.all(), 70 categorizations_list = category.categorizations.all() 71 72 c = RequestContext(request, 73 {'categorizations': categorizations_list, 72 74 'region_view': True, 73 75 'category': category}) -
cyclope/feeds.py
r212 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 47 47 objs = [] 48 48 for ctype in sites.site.base_content_types.keys(): 49 objs.extend(list(ctype.objects.all().order_by('-c reation_date')[:N]))49 objs.extend(list(ctype.objects.all().order_by('-content_object__creation_date')[:N])) 50 50 return sorted(objs, key=lambda x: x.creation_date, reverse = True)[:N] 51 51 … … 76 76 N = cyc_settings.CYCLOPE_RSS_LIMIT 77 77 return [c.content_object for c in 78 category.categorizations. order_by('-creation_date')[:N]]78 category.categorizations.all()[:N]] -
cyclope/migrations/0009_move_image_data_to_picture.py
r206 r215 29 29 30 30 def forwards(self, orm): 31 from cyclope.apps.articles.models import Article, ArticleImageData 32 from cyclope.apps.medialibrary.models import Picture 33 # we work with the actual models here because managing these generic relations with south is very complex 31 # we work with the actual models here because managing these generic relations with south is very complex and we won't be migrating backwards 32 33 try: 34 from cyclope.apps.articles.models import Article, ArticleImageData 35 from cyclope.apps.medialibrary.models import Picture 36 except: 37 return 38 34 39 for article in Article.objects.all(): 35 40 if article.images: -
cyclope/models.py
r214 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 271 271 object_id_field='self_id', 272 272 content_type_field='self_type') 273 creation_date = models.DateTimeField(_('creation date'), auto_now_add=True,274 editable= False, default=datetime.now())273 creation_date = models.DateTimeField(_('creation date'), 274 editable=True, default=datetime.now()) 275 275 modification_date = models.DateTimeField(_('modification date'), auto_now=True, 276 276 editable=False, default=datetime.now()) -
cyclope/tests.py
r154 r215 1 1 #!/usr/bin/env python 2 # -*- coding: UTF-8 -*-2 # -*- coding: utf-8 -*- 3 3 # 4 4 # Copyright 2010 Código Sur - Nuestra América Asoc. Civil / Fundación Pacificar. … … 35 35 from cyclope.apps.articles.models import Article 36 36 from cyclope.apps.medialibrary.models import * 37 from cyclope.apps.polls.models import * 37 38 38 39 def create_static_page(name=None): … … 268 269 269 270 def test_creation(self): 270 Article.objects.create(name='An instance') 271 author = Author.objects.create(name="the author") 272 Article.objects.create(name='An instance', author=author) 271 273 an_instance = Article.objects.get(slug='an-instance') 272 274 self.assertEqual(an_instance.name, 'An instance') 273 275 274 276 def test_content_views(self): 275 content_urls = get_content_urls(Article) 277 author = Author.objects.create(name="the author") 278 an_instance = Article.objects.create(name='An instance', author=author) 279 content_urls = get_content_urls(Article, an_instance) 276 280 for url in content_urls: 277 281 self.assertEqual(self.client.get(url).status_code, 200) … … 367 371 for url in content_urls: 368 372 self.assertEqual(self.client.get(url).status_code, 200) 373 374 375 class PollTestCase(TestCase): 376 def setUp(self): 377 frontend.autodiscover() 378 379 def test_creation(self): 380 Poll.objects.create(name='An instance') 381 an_instance = Poll.objects.get(slug='an-instance') 382 self.assertEqual(an_instance.name, 'An instance') 383 384 def test_content_views(self): 385 content_urls = get_content_urls(Poll) 386 for url in content_urls: 387 self.assertEqual(self.client.get(url).status_code, 200)
Note: See TracChangeset
for help on using the changeset viewer.

