added newsfeed and quotes
This commit is contained in:
parent
76b66bf959
commit
3981f14739
0
itf/newsfeed/__init__.py
Normal file
0
itf/newsfeed/__init__.py
Normal file
10
itf/newsfeed/admin.py
Normal file
10
itf/newsfeed/admin.py
Normal file
|
@ -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)
|
14
itf/newsfeed/models.py
Normal file
14
itf/newsfeed/models.py
Normal file
|
@ -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.
|
23
itf/newsfeed/tests.py
Normal file
23
itf/newsfeed/tests.py
Normal file
|
@ -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
|
||||
"""}
|
||||
|
1
itf/newsfeed/views.py
Normal file
1
itf/newsfeed/views.py
Normal file
|
@ -0,0 +1 @@
|
|||
# Create your views here.
|
0
itf/quotes/__init__.py
Normal file
0
itf/quotes/__init__.py
Normal file
3
itf/quotes/models.py
Normal file
3
itf/quotes/models.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
23
itf/quotes/tests.py
Normal file
23
itf/quotes/tests.py
Normal file
|
@ -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
|
||||
"""}
|
||||
|
1
itf/quotes/views.py
Normal file
1
itf/quotes/views.py
Normal file
|
@ -0,0 +1 @@
|
|||
# Create your views here.
|
Loading…
Reference in New Issue
Block a user