mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Added object on SingleObjectMixin returned context, some code clanup.
This commit is contained in:
parent
0038296135
commit
3eba8c7f7f
4 changed files with 23 additions and 19 deletions
|
@ -1,7 +1,6 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.core.paginator import Paginator
|
||||
from django.core.urlresolvers import reverse, reverse_lazy
|
||||
from django.utils.decorators import method_decorator
|
||||
|
@ -227,6 +226,10 @@ class CustomContextView(generic.detail.SingleObjectMixin, generic.View):
|
|||
def get_context_object_name(self, obj):
|
||||
return "test_name"
|
||||
|
||||
class CustomSingleObjectView(generic.detail.SingleObjectMixin, generic.View):
|
||||
model = Book
|
||||
object = Book(name="dummy")
|
||||
|
||||
class BookSigningConfig(object):
|
||||
model = BookSigning
|
||||
date_field = 'event_date'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue