From 3981f14739dbc0b6b20f535f52cf53ce5f681490 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 6 Mar 2011 18:23:47 +0530 Subject: [PATCH] added newsfeed and quotes --- itf/newsfeed/__init__.py | 0 itf/newsfeed/admin.py | 10 ++++++++++ itf/newsfeed/models.py | 14 ++++++++++++++ itf/newsfeed/tests.py | 23 +++++++++++++++++++++++ itf/newsfeed/views.py | 1 + itf/quotes/__init__.py | 0 itf/quotes/models.py | 3 +++ itf/quotes/tests.py | 23 +++++++++++++++++++++++ itf/quotes/views.py | 1 + 9 files changed, 75 insertions(+) create mode 100644 itf/newsfeed/__init__.py create mode 100644 itf/newsfeed/admin.py create mode 100644 itf/newsfeed/models.py create mode 100644 itf/newsfeed/tests.py create mode 100644 itf/newsfeed/views.py create mode 100644 itf/quotes/__init__.py create mode 100644 itf/quotes/models.py create mode 100644 itf/quotes/tests.py create mode 100644 itf/quotes/views.py diff --git a/itf/newsfeed/__init__.py b/itf/newsfeed/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/itf/newsfeed/admin.py b/itf/newsfeed/admin.py new file mode 100644 index 0000000..505d6b2 --- /dev/null +++ b/itf/newsfeed/admin.py @@ -0,0 +1,10 @@ +from django.contrib import admin +from models import * +# from forms import ArticleForm + +class NewsItemAdmin(admin.ModelAdmin): + search_fields = ('title', 'text',), +# list_display = ('title', 'date',) + + +admin.site.register(NewsItem, NewsItemAdmin) diff --git a/itf/newsfeed/models.py b/itf/newsfeed/models.py new file mode 100644 index 0000000..7825592 --- /dev/null +++ b/itf/newsfeed/models.py @@ -0,0 +1,14 @@ +from django.db import models +from app.models import ItfModel + + +class NewsItem(ItfModel): + title = models.CharField(max_length=512) + text = models.TextField(blank=True) + url = models.URLField() + created = models.DateTimeField(auto_now_add=True) + + def __unicode__(self): + return self.title + +# Create your models here. diff --git a/itf/newsfeed/tests.py b/itf/newsfeed/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/itf/newsfeed/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these 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.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/itf/newsfeed/views.py b/itf/newsfeed/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/itf/newsfeed/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/itf/quotes/__init__.py b/itf/quotes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/itf/quotes/models.py b/itf/quotes/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/itf/quotes/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/itf/quotes/tests.py b/itf/quotes/tests.py new file mode 100644 index 0000000..2247054 --- /dev/null +++ b/itf/quotes/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these 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.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/itf/quotes/views.py b/itf/quotes/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/itf/quotes/views.py @@ -0,0 +1 @@ +# Create your views here.