From ab581b79f6de57e4b415d49744d41561001be5e8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 7 Oct 2011 11:03:21 +0200 Subject: [PATCH] remove text/news, now in news --- pandora/news/models.py | 2 +- pandora/text/models.py | 18 ------------------ pandora/text/views.py | 39 --------------------------------------- 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/pandora/news/models.py b/pandora/news/models.py index cb054190b..3f7fd3973 100644 --- a/pandora/news/models.py +++ b/pandora/news/models.py @@ -14,7 +14,7 @@ class News(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) - user = models.ForeignKey(User) + user = models.ForeignKey(User, related_name='news') title = models.TextField() content = models.TextField() diff --git a/pandora/text/models.py b/pandora/text/models.py index e4ff094cc..abe312882 100644 --- a/pandora/text/models.py +++ b/pandora/text/models.py @@ -7,24 +7,6 @@ from django.db import models from django.contrib.auth.models import User -class News(models.Model): - created = models.DateTimeField(auto_now_add=True) - modified = models.DateTimeField(auto_now=True) - published = models.DateTimeField(default=datetime.now, editable=False) - public = models.BooleanField(default=False) - - user = models.ForeignKey(User) - slug = models.SlugField() - title = models.CharField(null=True, max_length=255) - body = models.TextField(default='') - - def __unicode__(self): - return u"%s <%s>" % (self.title, self.slug) - - def get_absolute_url(self): - return '/text/%s' % self.slug - - class Text(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) diff --git a/pandora/text/views.py b/pandora/text/views.py index 71e157ab2..5523c0135 100644 --- a/pandora/text/views.py +++ b/pandora/text/views.py @@ -11,45 +11,6 @@ import models from api.actions import actions -def getNews(request): - ''' - param data - string id - - return page - ''' - response = json_response({}) - itemId = json.loads(request.POST['data']) - item = get_object_or_404_json(models.News, pk=itemId) - response['data']['page'] = item.html() - return render_to_json_response(response) -actions.register(getNews) - - -@login_required_json -def editNews(request): - ''' - param data - string id - - return page - ''' - response = json_response({}) - itemId = json.loads(request.POST['data']) - item = get_object_or_404_json(models.Text, pk=itemId) - response['data']['page'] = item.html() - return render_to_json_response(response) -actions.register(editNews, cache=False) - - -def findNews(request): - ''' - ''' - response = json_response({}) - return render_to_json_response(response) -actions.register(findNews) - - def getText(request): ''' param data