﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26825	MultipleObjectMixin and DB don't work together	gilmrjc	nobody	"I have the following CBV for my home page:


{{{
class HomeView(ListView):
    """"""Home view.""""""
    template_name = 'index.html'
    model = Post
    context_object_name = 'posts'
    posts_per_page, _ = Option.objects.get_or_create(name='posts_per_page',
                                                     defaults={'value': '5'}
                                                     )
    try:                                             
        paginate_by = int(posts_per_page.value)
    except ValueError:
        paginate_by = 5

}}}

But Django fails with the following error:

''OperationalError: no such table: djangoapp_option
''

I can't do database migrations so this is a circular problem: Django complains because there isn't a database -> Database can't be migrated because Django complains -> Django complains . . . 
The problem seems to be that Django ""compiles"" CVB before doing anything, before running commands. Is this  bug or is a feature? Should I use function defined views for views that use database configurations?"	Uncategorized	closed	Uncategorized	1.9	Normal	invalid			Unreviewed	0	0	0	0	0	0
