import datetime
import os
import re
import unittest
from urllib.parse import parse_qsl, urljoin, urlparse
import pytz
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
from django.contrib.admin.options import TO_FIELD_VAR
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.admin.utils import quote
from django.contrib.admin.views.main import IS_POPUP_VAR
from django.contrib.auth import REDIRECT_FIELD_NAME, get_permission_codename
from django.contrib.auth.models import Group, Permission, User
from django.contrib.contenttypes.models import ContentType
from django.core import mail
from django.core.checks import Error
from django.core.files import temp as tempfile
from django.forms.utils import ErrorList
from django.template.response import TemplateResponse
from django.test import (
TestCase, modify_settings, override_settings, skipUnlessDBFeature,
)
from django.test.utils import override_script_prefix, patch_logger
from django.urls import NoReverseMatch, resolve, reverse
from django.utils import formats, translation
from django.utils.cache import get_max_age
from django.utils.encoding import iri_to_uri
from django.utils.html import escape
from django.utils.http import urlencode
from . import customadmin
from .admin import CityAdmin, site, site2
from .models import (
Actor, AdminOrderedAdminMethod, AdminOrderedCallable, AdminOrderedField,
AdminOrderedModelMethod, Answer, Answer2, Article, BarAccount, Book,
Bookmark, Category, Chapter, ChapterXtra1, ChapterXtra2, Character, Child,
Choice, City, Collector, Color, ComplexSortedPerson, CoverLetter,
CustomArticle, CyclicOne, CyclicTwo, DooHickey, Employee, EmptyModel,
Fabric, FancyDoodad, FieldOverridePost, FilteredManager, FooAccount,
FoodDelivery, FunkyTag, Gallery, Grommet, Inquisition, Language, Link,
MainPrepopulated, Media, ModelWithStringPrimaryKey, OtherStory, Paper,
Parent, ParentWithDependentChildren, ParentWithUUIDPK, Person, Persona,
Picture, Pizza, Plot, PlotDetails, PluggableSearchPerson, Podcast, Post,
PrePopulatedPost, Promo, Question, ReadablePizza, ReadOnlyPizza,
Recommendation, Recommender, RelatedPrepopulated, RelatedWithUUIDPKModel,
Report, Restaurant, RowLevelChangePermissionModel, SecretHideout, Section,
ShortMessage, Simple, State, Story, SuperSecretHideout, SuperVillain,
Telegram, TitleTranslation, Topping, UnchangeableObject, UndeletableObject,
UnorderedObject, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour,
)
ERROR_MESSAGE = "Please enter the correct username and password \
for a staff account. Note that both fields may be case-sensitive."
MULTIPART_ENCTYPE = 'enctype="multipart/form-data"'
class AdminFieldExtractionMixin:
"""
Helper methods for extracting data from AdminForm.
"""
def get_admin_form_fields(self, response):
"""
Return a list of AdminFields for the AdminForm in the response.
"""
admin_form = response.context['adminform']
fieldsets = list(admin_form)
field_lines = []
for fieldset in fieldsets:
field_lines += list(fieldset)
fields = []
for field_line in field_lines:
fields += list(field_line)
return fields
def get_admin_readonly_fields(self, response):
"""
Return the readonly fields for the response's AdminForm.
"""
return [f for f in self.get_admin_form_fields(response) if f.is_readonly]
def get_admin_readonly_field(self, response, field_name):
"""
Return the readonly field for the given field_name.
"""
admin_readonly_fields = self.get_admin_readonly_fields(response)
for field in admin_readonly_fields:
if field.field['name'] == field_name:
return field
@override_settings(ROOT_URLCONF='admin_views.urls', USE_I18N=True, USE_L10N=False, LANGUAGE_CODE='en')
class AdminViewBasicTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.superuser = User.objects.create_superuser(username='super', password='secret', email='super@example.com')
cls.s1 = Section.objects.create(name='Test section')
cls.a1 = Article.objects.create(
content='<p>Middle content</p>', date=datetime.datetime(2008, 3, 18, 11, 54, 58), section=cls.s1
)
cls.a2 = Article.objects.create(
content='<p>Oldest content</p>', date=datetime.datetime(2000, 3, 18, 11, 54, 58), section=cls.s1
)
cls.a3 = Article.objects.create(
content='<p>Newest content</p>', date=datetime.datetime(2009, 3, 18, 11, 54, 58), section=cls.s1
)
cls.p1 = PrePopulatedPost.objects.create(title='A Long Title', published=True, slug='a-long-title')
cls.color1 = Color.objects.create(value='Red', warm=True)
cls.color2 = Color.objects.create(value='Orange', warm=True)
cls.color3 = Color.objects.create(value='Blue', warm=False)
cls.color4 = Color.objects.create(value='Green', warm=False)
cls.fab1 = Fabric.objects.create(surface='x')
cls.fab2 = Fabric.objects.create(surface='y')
cls.fab3 = Fabric.objects.create(surface='plain')
cls.b1 = Book.objects.create(name='Book 1')
cls.b2 = Book.objects.create(name='Book 2')
cls.pro1 = Promo.objects.create(name='Promo 1', book=cls.b1)
cls.pro1 = Promo.objects.create(name='Promo 2', book=cls.b2)
cls.chap1 = Chapter.objects.create(title='Chapter 1', content='[ insert contents here ]', book=cls.b1)
cls.chap2 = Chapter.objects.create(title='Chapter 2', content='[ insert contents here ]', book=cls.b1)
cls.chap3 = Chapter.objects.create(title='Chapter 1', content='[ insert contents here ]', book=cls.b2)
cls.chap4 = Chapter.objects.create(title='Chapter 2', content='[ insert contents here ]', book=cls.b2)
cls.cx1 = ChapterXtra1.objects.create(chap=cls.chap1, xtra='ChapterXtra1 1')
cls.cx2 = ChapterXtra1.objects.create(chap=cls.chap3, xtra='ChapterXtra1 2')
Actor.objects.create(name='Palin', age=27)
# Post data for edit inline
cls.inline_post_data = {
"name": "Test section",
# inline data
"article_set-TOTAL_FORMS": "6",
"article_set-INITIAL_FORMS": "3",
"article_set-MAX_NUM_FORMS": "0",
"article_set-0-id": cls.a1.pk,
# there is no title in database, give one here or formset will fail.
"article_set-0-title": "Norske bostaver æøå skaper problemer",
"article_set-0-content": "<p>Middle content</p>",
"article_set-0-date_0": "2008-03-18",
"article_set-0-date_1": "11:54:58",
"article_set-0-section": cls.s1.pk,
"article_set-1-id": cls.a2.pk,
"article_set-1-title": "Need a title.",
"article_set-1-content": "<p>Oldest content</p>",
"article_set-1-date_0": "2000-03-18",
"article_set-1-date_1": "11:54:58",
"article_set-2-id": cls.a3.pk,
"article_set-2-title": "Need a title.",
"article_set-2-content": "<p>Newest content</p>",
"article_set-2-date_0": "2009-03-18",
"article_set-2-date_1": "11:54:58",
"article_set-3-id": "",
"article_set-3-title": "",
"article_set-3-content": "",
"article_set-3-date_0": "",
"article_set-3-date_1": "",
"article_set-4-id": "",
"article_se
没有合适的资源?快使用搜索试试~ 我知道了~
基于Django的成绩查询系统源码+说明.zip
共2000个文件
py:1601个
html:221个
js:92个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 124 浏览量
2024-05-06
08:31:38
上传
评论
收藏 12.77MB ZIP 举报
温馨提示
基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip基于Django的成绩查询系统源码+说明.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于Django的成绩查询系统源码+说明.zip (2000个子文件)
responsive.css 17KB
select2.css 17KB
base.css 16KB
select2.min.css 15KB
widgets.css 10KB
autocomplete.css 8KB
forms.css 8KB
qunit.css 7KB
changelists.css 6KB
rtl.css 4KB
responsive_rtl.css 2KB
login.css 1KB
ol3.css 657B
fonts.css 423B
dashboard.css 412B
fragments.css 359B
ignored.css 222B
relative.css 156B
absolute.css 153B
nonascii.css 79B
url.css 61B
window.css 56B
styles_root.css 52B
absolute_root.css 40B
faulty.css 28B
styles.css 26B
styles_insensitive.css 26B
bar.css 23B
foo.css 23B
import.css 22B
other.css 0B
strip_tags1.html 84KB
btAllcj.html 18KB
technical_500.html 17KB
default_urlconf.html 16KB
tests.html 4KB
tabular.html 4KB
base.html 4KB
change_form.html 3KB
change_list.html 3KB
index.html 3KB
technical_404.html 2KB
delete_confirmation.html 2KB
change_password.html 2KB
delete_selected_confirmation.html 2KB
stacked.html 2KB
password_change_form.html 2KB
jwcjcx.html 2KB
openlayers.html 2KB
login.html 2KB
openlayers.html 2KB
model_detail.html 2KB
fieldset.html 2KB
template_filter_index.html 2KB
template_tag_index.html 2KB
view_index.html 2KB
change_list_results.html 2KB
object_history.html 1KB
related_widget_wrapper.html 1KB
related_widget_wrapper.html 1KB
password_reset_confirm.html 1KB
bookmarklets.html 1KB
model_index.html 1KB
index.html 1KB
search_form.html 1020B
actions.html 1012B
template_detail.html 995B
password_reset_form.html 966B
view_detail.html 896B
submit_line.html 782B
missing_docutils.html 734B
password_change_done.html 671B
password_reset_done.html 669B
password_reset_email.html 582B
clearable_file_input.html 568B
pagination.html 553B
500.html 527B
password_reset_complete.html 505B
multiple_input.html 462B
clearable_file_input.html 461B
clearable_file_input.html 461B
invalid_setup.html 437B
multiple_input.html 431B
app_index.html 385B
select.html 384B
openlayers-osm.html 378B
logged_out.html 374B
date_hierarchy.html 370B
select.html 365B
popup_response.html 358B
foreign_key_raw_id.html 346B
filter.html 330B
base_site.html 316B
add_form.html 310B
404.html 268B
prepopulated_fields_js.html 245B
split_datetime.html 238B
custom_filter_template.html 233B
url.html 224B
input_option.html 205B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
生活家小毛.
- 粉丝: 6035
- 资源: 7290
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Microsoft-Office-2019-VL-Serializer-Universal office使用软件
- 三张卡牌类游戏demo
- (源码)基于Arduino的指纹识别与RFID读卡器访问控制系统.zip
- (源码)基于SpringCloud的新闻检索与推荐系统.zip
- (源码)基于C语言和C++的简单网站留言评论系统.zip
- (源码)基于Apache Mina框架的短信通信系统.zip
- 前端铺子开发者 前端杂货铺 小程序在线课堂+工具组件小程序uniapp移动端.zip
- Delphi TImage 增加支持 PNG 图片格式 TPNGImage
- (源码)基于C#的图书馆管理系统.zip
- (源码)基于Java和Bukkit框架的年龄管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功