Skip to content

Commit

Permalink
modify cbv
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijiasun committed Jun 17, 2014
1 parent d9410db commit abc5b60
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cbv/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from django.contrib import admin
from cbv.models import Article

# Register your models here.

admin.site.register(Article)
4 changes: 4 additions & 0 deletions cbv/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from django.db import models

# Create your models here.
class Article(models.Model):
title = models.CharField(max_length=80)
author = models.CharField(max_length=80)
content = models.TextField()
1 change: 1 addition & 0 deletions cbv/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
urlpatterns = patterns('',
url(r'^testtemplateview/$',TestTemplateView.as_view()),
url(r'^testredirectview/$',TestRedirectView.as_view()),
url(r'^testlistview/$',TestListView.as_view()),
)
11 changes: 10 additions & 1 deletion cbv/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.shortcuts import render
from django.views.generic import TemplateView,View,RedirectView
from django.views.generic import DetailView,CreateView,UpdateView,DeleteView,ListView,FormView
from cbv.forms import ContactForm
from django.views.generic.edit import FormView
from cbv.models import Article

# Create your views here.

Expand All @@ -27,3 +28,11 @@ class ContactView(FormView):

def form_valid(self):
pass


class TestListView(ListView):
model = Article
template_name = 'testlistview.html'

def get_context_data(self):
pass
Binary file modified db.sqlite3
Binary file not shown.

0 comments on commit abc5b60

Please sign in to comment.