websauna.tests.crud.tutorial module

Tutorial models and admins for CRUD testing.

class websauna.tests.crud.tutorial.Choice(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

choice_text

What the user sees for this choice

id

Database primary key for the row (running counter)

question
question_id

Which question this choice is part of

uuid

Publicly exposed non-guessable id

votes

How many times this choice has been voted

class websauna.tests.crud.tutorial.ChoiceAdmin(request)[source]

Bases: websauna.system.admin.modeladmin.ModelAdmin

class Resource(request, obj)[source]

Bases: websauna.system.admin.modeladmin.Resource

get_title()[source]

Title on show / edit / delete pages.

model

alias of Choice

plural_name = 'choices'
singular_name = 'choice'
title = 'Choices'
class websauna.tests.crud.tutorial.Question(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

choices

Relationship mapping between question and choice. Each choice can have only question. Deleteing question deletes its choices.

id

Database primary key for the row (running counter)

is_recent()[source]
published_at

When this question was published

question_text

Question text

uuid

Publicly exposed non-guessable

class websauna.tests.crud.tutorial.QuestionAdmin(request)[source]

Bases: websauna.system.admin.modeladmin.ModelAdmin

class Resource(request, obj)[source]

Bases: websauna.system.admin.modeladmin.Resource

get_title()[source]

Title on show / edit / delete pages.

model

alias of Question

plural_name = 'questions'
singular_name = 'question'
title = 'Questions'