nkdsu package¶
Subpackages¶
- nkdsu.apps package
- Subpackages
- nkdsu.apps.vote package
- Subpackages
- Submodules
- nkdsu.apps.vote.admin module
- nkdsu.apps.vote.anime module
- nkdsu.apps.vote.api_utils module
- nkdsu.apps.vote.apps module
- nkdsu.apps.vote.context_processors module
- nkdsu.apps.vote.elfs module
- nkdsu.apps.vote.emoji module
- nkdsu.apps.vote.forms module
- nkdsu.apps.vote.managers module
- nkdsu.apps.vote.mastodon_instances module
- nkdsu.apps.vote.mixcloud module
- nkdsu.apps.vote.mixins module
- nkdsu.apps.vote.models module
- nkdsu.apps.vote.myriad_export module
- nkdsu.apps.vote.parsers module
- nkdsu.apps.vote.placeholder_avatars module
- nkdsu.apps.vote.signals module
- nkdsu.apps.vote.trivia module
- nkdsu.apps.vote.twitter_auth module
- nkdsu.apps.vote.update_library module
- nkdsu.apps.vote.urls module
- nkdsu.apps.vote.utils module
- nkdsu.apps.vote.validators module
- nkdsu.apps.vote.voter module
- nkdsu.apps.vote package
- Subpackages
Submodules¶
nkdsu.forms module¶
- class nkdsu.forms.RegistrationForm(*args, **kwargs)[source]¶
Bases:
TriviaForm
,UserCreationForm
- _meta = <django.forms.models.ModelFormOptions object>¶
- base_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'trivia': <django.forms.fields.CharField object>, 'trivia_question': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}¶
- declared_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'trivia': <django.forms.fields.CharField object>, 'trivia_question': <django.forms.fields.CharField object>}¶
- property media¶
- class nkdsu.forms.ResetPasswordForm(*args, **kwargs)[source]¶
Bases:
TriviaForm
,ResetPasswordForm
- base_fields = {'email': <django.forms.fields.EmailField object>, 'trivia': <django.forms.fields.CharField object>, 'trivia_question': <django.forms.fields.CharField object>}¶
- declared_fields = {'email': <django.forms.fields.EmailField object>, 'trivia': <django.forms.fields.CharField object>, 'trivia_question': <django.forms.fields.CharField object>}¶
- property media¶
nkdsu.icons module¶
nkdsu.middleware module¶
nkdsu.mixins module¶
nkdsu.monkey module¶
Horrible hacks. Please ignore.
- nkdsu.monkey._replace_password_validators_help_text_html() None [source]¶
Don’t use a
<ul>
to surface multiple password requirements against password fields. It’s invalid HTML when used within anas_p()
-rendered form, and browsers interpret the DOM structure wrong as a result. As far as Firefox is concerned, if we let Django do what it does by default, these help texts aren’t within a.helptext
element at all.I hope this is made unnecessary if we adopt the
<div>
-based form renderer that becomes the default in Django 5.0.
nkdsu.settings module¶
- nkdsu.settings.MAX_REQUEST_TRACKS = 6¶
The maximum number of tracks that can be associated with a single Vote object
nkdsu.settings_local module¶
nkdsu.settings_local_example module¶
nkdsu.settings_profile module¶
nkdsu.settings_testing module¶
nkdsu.tests module¶
- class nkdsu.tests.EverythingTest(methodName='runTest')[source]¶
Bases:
ExternalLinks
,ValidHTML5
,ValidJSON
,InstantCoverageMixin
,TestCase
- fixtures = ['vote.json']¶
- covered_urls: Sequence[str] = ['/vote-admin/tw-abuse/46162630/', '/vote-admin/local-abuse/45/', '/vote-admin/block/0007C3F2760E0541/', '/vote-admin/block/0007C3F2760E0541/reason?reason=announced', '/vote-admin/unblock/0007C3F2760E0541/', '/vote-admin/archive/0007C3F2760E0541/', '/vote-admin/unarchive/0007C3F2760E0541/', '/vote-admin/hide/0007C3F2760E0541/', '/vote-admin/unhide/0007C3F2760E0541/', '/vote-admin/lm/0007C3F2760E0541/', '/vote-admin/ulm/0007C3F2760E0541/', '/vote-admin/shortlist/0007C3F2760E0541/', '/vote-admin/discard/0007C3F2760E0541/', '/vote-admin/reset/0007C3F2760E0541/', '/vote-admin/make-note/0007C3F2760E0541/', '/vote-admin/post-about-play/0007C3F2760E0541/', '/vote-admin/migrate-away-from/0007C3F2760E0541/', '/vote-admin/remove-note/2/', '/vote-admin/archived/', '/vote-admin/hidden/', '/vote-admin/no-media-id/', '/vote-admin/inudesu/', '/vote-admin/artless/', '/vote-admin/add-manual-vote/0007C3F2760E0541/', '/vote-admin/upload/', '/vote-admin/upload-myriad/', '/vote-admin/requests/', '/vote-admin/check-metadata/', '/vote-admin/play/0007C3F2760E0541/', '/js/deselect/', '/js/select/', '/js/selection/', '/js/clear_selection/', '/api/', '/api/week/', '/api/week/2014-02-05/', '/api/track/0007C3F2760E0541/', '/api/search/?q=Canpeki', '/api/user/EuricaeriS/', '/', '/browse/', '/anime/', '/artists/', '/years/', '/composers/', '/roles/', '/info/', '/info/api/', '/info/privacy/', '/info/tos/', '/profile/', '/request/?t=0007C3F2760E0541', '/request-addition/', '/add-to-list/?t=0007C3F2760E0541', '/roulette/', '/roulette/hipster/', '/roulette/indiscriminate/', '/roulette/staple/', '/roulette/decade/', '/roulette/decade/1970/', '/roulette/short/1/', '/roulette/pro/', '/archive/', '/archive/2014/', '/stats/', '/0007C3F2760E0541/', '/canpeki-shinakya/0007C3F2760E0541/', '/0007C3F2760E0541/report/', '/artist/Hikasa Youko/', '/anime/Ro-Kyu-Bu!/', '/composer/folks/', '/year/2014/', '/show/2014-02-05/listen/', '/show/2014-02-05/', '/show/', '/added/2014-02-05/', '/added/', '/search/?q=Canpeki', '/user/EuricaeriS/', '/@what/', '/@what/list/coollist-for-pros/', '/profile/email/', '/profile/', '/confirm-email/', '/confirm-email/abc/', '/login/', '/account/login/', '/register/', '/account/register/', '/change-password/', '/change-password/done/', '/reset-password/', '/reset-password/done/', '/reset-password/key/abc-def/', '/reset-password/key/done/']¶
URLs to test
- uncovered_urls: Sequence[str] = ['/vote-admin/upload/confirm/', '/vote-admin/shortlist-selection/', '/vote-admin/discard-selection/', '/vote-admin/hide-selection/', '/vote-admin/unhide-selection/', '/vote-admin/archive-selection/', '/vote-admin/unarchive-selection/', '/vote-admin/reset-shortlist-discard-selection/', '/@what/list-members/coollist-for-pros/', '/vote-admin/shortlist-order/', '/vote-admin/requests/fill/1/', '/vote-admin/requests/claim/1/', '/vote-admin/requests/shelf/1/', '/set-dark-mode/', '/logout/', '/account/logout/', '/anime-picture/Ro-Kyu-Bu!/', '/set-password/', '/update-request/1/', '/vote-admin/unmatched-anime/', '/vote-admin/throw-500/']¶
URLs we’re okay with not testing
- uncovered_includes: Sequence[Tuple[str, ...]] = [('^admin/',), ('^s/',)]¶
tuples of includes we’re okay with not testing (see README for more details)
- instant_tracebacks = True¶
whether to show full tracebacks in test_no_errors
- _classSetupFailed = False¶
- _class_cleanups = []¶
- class nkdsu.tests.LoggedInEverythingTest(methodName='runTest')[source]¶
Bases:
EverythingTest
- covered_urls: Sequence[str] = ['/update-request/123/', '/vote-admin/tw-abuse/46162630/', '/vote-admin/local-abuse/45/', '/vote-admin/block/0007C3F2760E0541/', '/vote-admin/block/0007C3F2760E0541/reason?reason=announced', '/vote-admin/unblock/0007C3F2760E0541/', '/vote-admin/archive/0007C3F2760E0541/', '/vote-admin/unarchive/0007C3F2760E0541/', '/vote-admin/hide/0007C3F2760E0541/', '/vote-admin/unhide/0007C3F2760E0541/', '/vote-admin/lm/0007C3F2760E0541/', '/vote-admin/ulm/0007C3F2760E0541/', '/vote-admin/shortlist/0007C3F2760E0541/', '/vote-admin/discard/0007C3F2760E0541/', '/vote-admin/reset/0007C3F2760E0541/', '/vote-admin/make-note/0007C3F2760E0541/', '/vote-admin/post-about-play/0007C3F2760E0541/', '/vote-admin/migrate-away-from/0007C3F2760E0541/', '/vote-admin/remove-note/2/', '/vote-admin/archived/', '/vote-admin/hidden/', '/vote-admin/no-media-id/', '/vote-admin/inudesu/', '/vote-admin/artless/', '/vote-admin/add-manual-vote/0007C3F2760E0541/', '/vote-admin/upload/', '/vote-admin/upload-myriad/', '/vote-admin/requests/', '/vote-admin/check-metadata/', '/vote-admin/play/0007C3F2760E0541/', '/js/deselect/', '/js/select/', '/js/selection/', '/js/clear_selection/', '/api/', '/api/week/', '/api/week/2014-02-05/', '/api/track/0007C3F2760E0541/', '/api/search/?q=Canpeki', '/api/user/EuricaeriS/', '/', '/browse/', '/anime/', '/artists/', '/years/', '/composers/', '/roles/', '/info/', '/info/api/', '/info/privacy/', '/info/tos/', '/profile/', '/request/?t=0007C3F2760E0541', '/request-addition/', '/add-to-list/?t=0007C3F2760E0541', '/roulette/', '/roulette/hipster/', '/roulette/indiscriminate/', '/roulette/staple/', '/roulette/decade/', '/roulette/decade/1970/', '/roulette/short/1/', '/roulette/pro/', '/archive/', '/archive/2014/', '/stats/', '/0007C3F2760E0541/', '/canpeki-shinakya/0007C3F2760E0541/', '/0007C3F2760E0541/report/', '/artist/Hikasa Youko/', '/anime/Ro-Kyu-Bu!/', '/composer/folks/', '/year/2014/', '/show/2014-02-05/listen/', '/show/2014-02-05/', '/show/', '/added/2014-02-05/', '/added/', '/search/?q=Canpeki', '/user/EuricaeriS/', '/@what/', '/@what/list/coollist-for-pros/', '/profile/email/', '/profile/', '/confirm-email/', '/confirm-email/abc/', '/login/', '/account/login/', '/register/', '/account/register/', '/change-password/', '/change-password/done/', '/reset-password/', '/reset-password/done/', '/reset-password/key/abc-def/', '/reset-password/key/done/']¶
URLs to test
- _classSetupFailed = False¶
- _class_cleanups = []¶
- class nkdsu.tests.ElfEverythingTest(methodName='runTest')[source]¶
Bases:
EverythingTest
- covered_urls: Sequence[str] = ['/vote-admin/unmatched-anime/', '/vote-admin/tw-abuse/46162630/', '/vote-admin/local-abuse/45/', '/vote-admin/block/0007C3F2760E0541/', '/vote-admin/block/0007C3F2760E0541/reason?reason=announced', '/vote-admin/unblock/0007C3F2760E0541/', '/vote-admin/archive/0007C3F2760E0541/', '/vote-admin/unarchive/0007C3F2760E0541/', '/vote-admin/hide/0007C3F2760E0541/', '/vote-admin/unhide/0007C3F2760E0541/', '/vote-admin/lm/0007C3F2760E0541/', '/vote-admin/ulm/0007C3F2760E0541/', '/vote-admin/shortlist/0007C3F2760E0541/', '/vote-admin/discard/0007C3F2760E0541/', '/vote-admin/reset/0007C3F2760E0541/', '/vote-admin/make-note/0007C3F2760E0541/', '/vote-admin/post-about-play/0007C3F2760E0541/', '/vote-admin/migrate-away-from/0007C3F2760E0541/', '/vote-admin/remove-note/2/', '/vote-admin/archived/', '/vote-admin/hidden/', '/vote-admin/no-media-id/', '/vote-admin/inudesu/', '/vote-admin/artless/', '/vote-admin/add-manual-vote/0007C3F2760E0541/', '/vote-admin/upload/', '/vote-admin/upload-myriad/', '/vote-admin/requests/', '/vote-admin/check-metadata/', '/vote-admin/play/0007C3F2760E0541/', '/js/deselect/', '/js/select/', '/js/selection/', '/js/clear_selection/', '/api/', '/api/week/', '/api/week/2014-02-05/', '/api/track/0007C3F2760E0541/', '/api/search/?q=Canpeki', '/api/user/EuricaeriS/', '/', '/browse/', '/anime/', '/artists/', '/years/', '/composers/', '/roles/', '/info/', '/info/api/', '/info/privacy/', '/info/tos/', '/profile/', '/request/?t=0007C3F2760E0541', '/request-addition/', '/add-to-list/?t=0007C3F2760E0541', '/roulette/', '/roulette/hipster/', '/roulette/indiscriminate/', '/roulette/staple/', '/roulette/decade/', '/roulette/decade/1970/', '/roulette/short/1/', '/roulette/pro/', '/archive/', '/archive/2014/', '/stats/', '/0007C3F2760E0541/', '/canpeki-shinakya/0007C3F2760E0541/', '/0007C3F2760E0541/report/', '/artist/Hikasa Youko/', '/anime/Ro-Kyu-Bu!/', '/composer/folks/', '/year/2014/', '/show/2014-02-05/listen/', '/show/2014-02-05/', '/show/', '/added/2014-02-05/', '/added/', '/search/?q=Canpeki', '/user/EuricaeriS/', '/@what/', '/@what/list/coollist-for-pros/', '/profile/email/', '/profile/', '/confirm-email/', '/confirm-email/abc/', '/login/', '/account/login/', '/register/', '/account/register/', '/change-password/', '/change-password/done/', '/reset-password/', '/reset-password/done/', '/reset-password/key/abc-def/', '/reset-password/key/done/']¶
URLs to test
- _classSetupFailed = False¶
- _class_cleanups = []¶
nkdsu.urls module¶
nkdsu.views module¶
- class nkdsu.views.LoginView(**kwargs)[source]¶
Bases:
MarkdownView
,LoginView
- class nkdsu.views.RegisterView(**kwargs)[source]¶
Bases:
CreateView
- template_name = 'auth/register.html'¶
- form_class¶
alias of
RegistrationForm
- success_url = '/profile/'¶
- form_valid(form: RegistrationForm) HttpResponse [source]¶
- class nkdsu.views.SetPasswordView(**kwargs)[source]¶
Bases:
FormView
- template_name = 'auth/set_password.html'¶
- form_class¶
alias of
SetPasswordForm
- success_url = '/login/'¶
- form_valid(form: SetPasswordForm) HttpResponse [source]¶
- class nkdsu.views.EmailView(**kwargs)[source]¶
Bases:
LoginRequiredMixin
,BreadcrumbMixin
,EmailView
- class nkdsu.views.PasswordResetView(**kwargs)[source]¶
Bases:
PasswordResetView
- form_class¶
alias of
ResetPasswordForm