o 3a[@sddlZddlmZddlmZddlmZddlmZm Z m Z ddl m Z ddl mZddlmZdd lmZdd lmZdd lmZmZmZdd lmZdd lmZddlmZddZddZ ddZ!ddZ"GdddZ#Gddde#Z$Gddde#Z%ddZ&dd Z'd!d"Z(dS)#N)chain)apps)settings)NotRelationFieldflattenget_fields_from_path)checks)FieldDoesNotExist)models) LOOKUP_SEP) Combinable) BaseModelFormBaseModelFormSet_get_foreign_key)engines)DjangoTemplates) import_stringcCs"zt||WStyYdSw)zX issubclass() variant that doesn't raise an exception if cls isn't a class. F) issubclass TypeError)cls classinfor=/usr/lib/python3/dist-packages/django/contrib/admin/checks.py _issubclasss   rc CsFt|}|D]}zt|}Wn tyYqwt||r dSqdS)z| Return whether or not a dotted class path (or a subclass of that class) is found in a list of candidate paths. TF)r ImportErrorr) class_pathcandidate_pathsrpath candidate_clsrrr_contains_subclass!s   rcKs.ddlm}g}|D] }|||q |S)Nr all_sites)django.contrib.admin.sitesr!extendcheck) app_configskwargsr!errorssiterrrcheck_admin_app2s r)c Ksxddlm}tds gSg}d}|D]\}}t|s*|tjd|d|dqtD] }t |t r;|j }nq/d}|sK|tjd d dn>d |j vr`t d tjr`|tjd ddd|j vro|tjdddtdd|D}|rd|j vr|tjdddt dtjs|tjdddt dtjs|tjdddt dtjs|tjddd d!|S)"zF Check that the admin's dependencies are correctly installed. rr zdjango.contrib.admin))zdjango.contrib.contenttypesi)zdjango.contrib.authi)zdjango.contrib.messagesizE'%s' must be in INSTALLED_APPS in order to use the admin application.z admin.E%d)idNzA 'django.template.backends.django.DjangoTemplates' instance must be configured in TEMPLATES in order to use the admin application.z admin.E403z+django.contrib.auth.context_processors.authz)django.contrib.auth.backends.ModelBackendz'django.contrib.auth.context_processors.auth' must be enabled in DjangoTemplates (TEMPLATES) if using the default auth backend in order to use the admin application.z admin.E402z3django.contrib.messages.context_processors.messagesz'django.contrib.messages.context_processors.messages' must be enabled in DjangoTemplates (TEMPLATES) in order to use the admin application.z admin.E404css|]}|jVqdSN)enable_nav_sidebar).0r(rrr msz%check_dependencies..z*django.template.context_processors.requestz'django.template.context_processors.request' must be enabled in DjangoTemplates (TEMPLATES) in order to use the admin navigation sidebar.z admin.W411z7django.contrib.auth.middleware.AuthenticationMiddlewarezv'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.z admin.E408z4django.contrib.messages.middleware.MessageMiddlewarezs'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application.z admin.E409z4django.contrib.sessions.middleware.SessionMiddlewarezs'django.contrib.sessions.middleware.SessionMiddleware' must be in MIDDLEWARE in order to use the admin application.zInsert 'django.contrib.sessions.middleware.SessionMiddleware' before 'django.contrib.auth.middleware.AuthenticationMiddleware'.z admin.E410)hintr*)r"r!r is_installedappendrErrorrall isinstancerenginecontext_processorsrrAUTHENTICATION_BACKENDSanyWarning MIDDLEWARE) r&r!r'app_dependenciesapp_name error_coder5django_templates_instancesidebar_enabledrrrcheck_dependencies:s            r@c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7S)8BaseModelAdminCheckscKsg||||||||||||||||||| || || || |Sr+) _check_autocomplete_fields_check_raw_id_fields _check_fields_check_fieldsets_check_exclude _check_form_check_filter_vertical_check_filter_horizontal_check_radio_fields_check_prepopulated_fields_check_view_on_site_url_check_ordering_check_readonly_fieldsself admin_objr&rrrr$s6     zBaseModelAdminChecks.checkcDtjttfstddddSttfddtjDS)zV Check that `autocomplete_fields` is a list or tuple of model fields. a list or tupleautocomplete_fieldsz admin.E036optionobjr*cs"g|] \}}|d|qS)zautocomplete_fields[%d])_check_autocomplete_fields_itemr-index field_namerWrPrr szCBaseModelAdminChecks._check_autocomplete_fields..)r4rTlisttuplemust_ber from_iterable enumeraterPrWrr\rrB  z/BaseModelAdminChecks._check_autocomplete_fieldsc Csz |jj|}Wntyt|||ddYSw|js,t|tjs,t d||ddS|j j |j j}|durMtjd|j jjt|jf|jdd gS|jsctjd |jjt|jf|jd d gSgS) z Check that an item in `autocomplete_fields` is a ForeignKey or a ManyToManyField and that the item has a related ModelAdmin with search_fields defined. z admin.E037fieldrVrWr*%a foreign key or a many-to-many fieldz admin.E038rUNzXAn admin for model "%s" has to be registered to be referenced by %s.autocomplete_fields.z admin.E039rWr*zR%s must define "search_fields", because it's referenced by %s.autocomplete_fields.z admin.E040)model_meta get_fieldr refer_to_missing_field many_to_manyr4r ForeignKeyr` admin_site _registryget remote_fieldrr2__name__type __class__ search_fields)rPrWr[labelrf related_adminrrrrXsD   z4BaseModelAdminChecks._check_autocomplete_fields_itemcrR)z\ Check that `raw_id_fields` only contains field names that are listed on the model. rS raw_id_fieldsz admin.E001rUc3&|]\}}|d|VqdS)zraw_id_fields[%d]N)_check_raw_id_fields_itemrYr\rrr.  z.)r4ryr^r_r`rrarbrcrr\rrCrdz)BaseModelAdminChecks._check_raw_id_fieldsc Cs\z |jj|}Wntyt|||ddYSw|js,t|tjs,t d||ddSgS)z Check an item of `raw_id_fields`, i.e. check that field named `field_name` exists in model `model` and is a ForeignKey or a ManyToManyField. z admin.E002rergz admin.E003rU) rirjrkr rlrmr4r rnr`rPrWr[rwrfrrrr{s z.BaseModelAdminChecks._check_raw_id_fields_itemcsjdurgStjttfstddddSjr$tjdjddgSt j}t |t t |kr=tjd jd dgStt fd d jDS) z Check that `fields` only refer to existing fields, doesn't contain duplicates. Check if at most one of `fields` and `fieldsets` is defined. NrSfieldsz admin.E004rUz,Both 'fieldsets' and 'fields' are specified.z admin.E005rhz2The value of 'fields' contains duplicate field(s).z admin.E006c3s|] }|dVqdS)r~N_check_field_spec)r-r[r\rrr.s  z5BaseModelAdminChecks._check_fields..)r~r4r^r_r` fieldsetsrr2rurlensetrra)rPrWr~rr\rrDs,   z"BaseModelAdminChecks._check_fieldscsXjdurgStjttfstddddSgttfddtjDS)zT Check that fieldsets is properly formatted and doesn't contain duplicates. NrSrz admin.E007rUc3s(|]\}}|d|VqdS)z fieldsets[%d]N)_check_fieldsets_item)r-rZfieldsetrW seen_fieldsrPrrr.!s  z8BaseModelAdminChecks._check_fieldsets..)rr4r^r_r`rrarbrcrrrrEs  z%BaseModelAdminChecks._check_fieldsetscst|ttfstdddSt|dkrtdddSt|dts.tdd d dSd |dvr@tjd jd dgSt|dd ttfsUtddddS| t |dd t|tt |krvtjdjddgStt fdd|dd DS)z~ Check an item of `fieldsets`, i.e. check that this is a pair of a set name and a dictionary containing "fields" key. rSz admin.E008rUz of length 2z admin.E009 a dictionary%s[1]z admin.E010r~z3The value of '%s[1]' must contain the key 'fields'.z admin.E011rhz%s[1]['fields']z(There are duplicate field(s) in '%s[1]'.z admin.E012c3s"|] }|dVqdS)z%s[1]["fields"]Nr)r-fieldset_fieldsrwrWrPrrr.Ds  z=BaseModelAdminChecks._check_fieldsets_item..)r4r^r_r`rdictrr2rur#rrrra)rPrWrrwrrrrr&s4    z*BaseModelAdminChecks._check_fieldsets_itemcs<t|trttfddt|DS|S)z `fields` should be an item of `fields` or an item of fieldset[1]['fields'] for any `fieldset` in `fieldsets`. It should be a field name or a tuple of field names. c3*|]\}}|d|fVqdS)z%s[%d]N)_check_field_spec_itemrYrrrr.O  z9BaseModelAdminChecks._check_field_spec..)r4r_r^rrarbr)rPrWr~rwrrrrIs  z&BaseModelAdminChecks._check_field_speccCsp||jvrgSz |jj|}Wn tygYSwt|tjr6|jj jj s6t j d||f|j ddgSgS)NzvThe value of '%s' cannot include the ManyToManyField '%s', because that field manually specifies a relationship model.z admin.E013rh)readonly_fieldsrirjrkr r4r ManyToManyFieldrrthrough auto_createdrr2rur}rrrrVs&     z+BaseModelAdminChecks._check_field_spec_itemcCs^|jdurgSt|jttfstdd|ddSt|jtt|jkr-tjd|j ddgSgS) z6 Check that exclude is a sequence without duplicates. NrSexcludez admin.E014rUz3The value of 'exclude' contains duplicate field(s).z admin.E015rh) rr4r^r_r`rrrr2rurcrrrrFrs z#BaseModelAdminChecks._check_excludecC t|jtstdd|ddSgS)z+ Check that form subclasses BaseModelForm. r formz admin.E016parentrVrWr*)rrr must_inherit_fromrcrrrrGs z BaseModelAdminChecks._check_formcrR)z: Check that filter_vertical is a sequence of field names. rSfilter_verticalz admin.E017rUc3rz)zfilter_vertical[%d]N_check_filter_itemrYr\rrr.r|z>BaseModelAdminChecks._check_filter_vertical..)r4rr^r_r`rrarbrcrr\rrH  z+BaseModelAdminChecks._check_filter_verticalcrR)z< Check that filter_horizontal is a sequence of field names. rSfilter_horizontalz admin.E018rUc3rz)zfilter_horizontal[%d]NrrYr\rrr.r|z@BaseModelAdminChecks._check_filter_horizontal..)r4rr^r_r`rrarbrcrr\rrIrz-BaseModelAdminChecks._check_filter_horizontalc CsPz |jj|}Wntyt|||ddYSw|js&td||ddSgS)z Check one item of `filter_vertical` or `filter_horizontal`, i.e. check that given field exists and is a ManyToManyField. z admin.E019reza many-to-many fieldz admin.E020rU)rirjrkr rlrmr`r}rrrrs z'BaseModelAdminChecks._check_filter_itemc@tjtstddddSttfddjDS)z, Check that `radio_fields` is a dictionary. r radio_fieldsz admin.E021rUc34|]\}}|d|d|VqdS)rzradio_fields["%s"]N)_check_radio_fields_key_check_radio_fields_valuer-r[valr\rrr.  z;BaseModelAdminChecks._check_radio_fields..)r4rrr`r^rraitemsrcrr\rrJs  z(BaseModelAdminChecks._check_radio_fieldsc Cshz |jj|}Wntyt|||ddYSwt|tjs2|js2t j d||f|j ddgSgS)z Check that a key of `radio_fields` dictionary is name of existing field and that the field is a ForeignKey or has `choices` defined. z admin.E022rezsThe value of '%s' refers to '%s', which is not an instance of ForeignKey, and does not have a 'choices' definition.z admin.E023rh) rirjrkr rlr4r rnchoicesrr2rur}rrrrs   z,BaseModelAdminChecks._check_radio_fields_keycCs8ddlm}m}|||fvrtjd||jddgSgS)z5 Check type of a value of `radio_fields` dictionary. r) HORIZONTALVERTICALzDThe value of '%s' must be either admin.HORIZONTAL or admin.VERTICAL.z admin.E024rh)django.contrib.admin.optionsrrrr2ru)rPrWrrwrrrrrrs z.BaseModelAdminChecks._check_radio_fields_valuecCs.t|jst|jtstjd|jddgSgS)NzBThe value of 'view_on_site' must be a callable or a boolean value.z admin.E025rh)callable view_on_siter4boolrr2rurcrrrrLsz,BaseModelAdminChecks._check_view_on_site_urlcr)zZ Check that `prepopulated_fields` is a dictionary containing allowed field types. rprepopulated_fieldsz admin.E026rUc3r)rzprepopulated_fields["%s"]N)_check_prepopulated_fields_key _check_prepopulated_fields_valuerr\rrr.rzBBaseModelAdminChecks._check_prepopulated_fields..)r4rrr`r^rrarrcrr\rrKs  z/BaseModelAdminChecks._check_prepopulated_fieldsc Cslz |jj|}Wntyt|||ddYSwt|tjtjtj fr4t j d||f|j ddgSgS)z Check a key of `prepopulated_fields` dictionary, i.e. check that it is a name of existing field and the field is one of the allowed types. z admin.E027rezyThe value of '%s' refers to '%s', which must not be a DateTimeField, a ForeignKey, a OneToOneField, or a ManyToManyField.z admin.E028rh) rirjrkr rlr4r DateTimeFieldrnrrr2rur}rrrrs  z3BaseModelAdminChecks._check_prepopulated_fields_keycsBt|ttfstdddSttfddt|DS)zf Check a value of `prepopulated_fields` dictionary, i.e. it's an iterable of existing fields. rSz admin.E029rUc3r)z%s[%r]N)%_check_prepopulated_fields_value_item)r-rZ subfield_namerrrr.rzHBaseModelAdminChecks._check_prepopulated_fields_value..)r4r^r_r`rrarb)rPrWrrwrrrrs  z5BaseModelAdminChecks._check_prepopulated_fields_valuec Cs8z |jj|WgStyt|||ddYSw)z[ For `prepopulated_fields` equal to {"slug": ("title",)}, `field_name` is "title". z admin.E030re)rirjrkr rlrPrWr[rwrrrrs  z:BaseModelAdminChecks._check_prepopulated_fields_value_itemcsRjdurgStjttfstddddSttfddtjDS)z= Check that ordering refers to existing fields or is random. NrSorderingz admin.E031rUc3rz)z ordering[%d]N)_check_ordering_itemrYr\rrr..r|z7BaseModelAdminChecks._check_ordering..)rr4r^r_r`rrarbrcrr\rrM%s  z$BaseModelAdminChecks._check_orderingc Cst|ttjfr t|tjs|}t|jtjr|jj}ngS|dkr6t|j dkr6t j dd|j ddgS|dkrBaseModelAdminChecks._check_readonly_fields..)rr4r^r_r`rrarbrcrr\rrNXs  z+BaseModelAdminChecks._check_readonly_fieldscCszt|rgSt||r gSt|j|rgSz |jj|WgSty<tjd||jj |jjj f|jddgYSw)NzSThe value of '%s' is not a callable, an attribute of '%s', or an attribute of '%s'.z admin.E035rh) rhasattrrirjrkr rr2rursrwrrrrres(   z0BaseModelAdminChecks._check_readonly_fields_itemN)rs __module__ __qualname__r$rBrXrCr{rDrErrrrFrGrHrIrrJrrrLrKrrrrMrrNrrrrrrAs8 +  #        % rAcseZdZfddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(ZZS))ModelAdminChecksc sgt|||||||||||||||| || || || || |||||Sr+)superr$_check_save_as_check_save_on_top_check_inlines_check_list_display_check_list_display_links_check_list_filter_check_list_select_related_check_list_per_page_check_list_max_show_all_check_list_editable_check_search_fields_check_date_hierarchy _check_action_permission_methods_check_actions_uniquenessrOrurrr$s>      zModelAdminChecks.checkcCr)z Check save_as is a boolean. a booleansave_asz admin.E101rU)r4rrr`rcrrrr zModelAdminChecks._check_save_ascCr)z! Check save_on_top is a boolean. r save_on_topz admin.E102rU)r4rrr`rcrrrrrz#ModelAdminChecks._check_save_on_topcrR)z' Check all inline model admin classes. rSinlinesz admin.E103rUc3rz)z inlines[%d]N)_check_inlines_itemr-rZitemr\rrr.r|z2ModelAdminChecks._check_inlines..)r4rr^r_r`rrarbrcrr\rrs  zModelAdminChecks._check_inlinescCsz |jd|j}Wntytjd||jddgYSwddlm}t||s7tjd||jddgS|j sFtjd||jddgSt|j t j sWt d d ||d d S||j |j S) z Check one inline model admin. .z*'%s' must inherit from 'InlineModelAdmin'.z admin.E104rhr)InlineModelAdminz#'%s' must have a 'model' attribute.z admin.E105za Modelz%s.modelz admin.E106rU)rrsAttributeErrorrr2rurrrrir Modelr`ror$)rPrWinlinerw inline_labelrrrrrs8  z$ModelAdminChecks._check_inlines_itemcrR)zL Check that list_display only contains fields or usable attributes. rS list_displayz admin.E107rUc3rz)zlist_display[%d]N)_check_list_display_itemrr\rrr.r|z7ModelAdminChecks._check_list_display..)r4rr^r_r`rrarbrcrr\rrrdz$ModelAdminChecks._check_list_displayc Cst|rgSt||r gSz |jj|}Wn2tyHzt|j|}Wn tyEtj d|||j j |jjj f|j ddgYYSwYnwt |tjr[tj d||j ddgSgS)NzsThe value of '%s' refers to '%s', which is not a callable, an attribute of '%s', or an attribute or method on '%s'.z admin.E108rhz0The value of '%s' must not be a ManyToManyField.z admin.E109)rrrirjrkr getattrrrr2rursrwr4r r)rPrWrrwrfrrrrs>      z)ModelAdminChecks._check_list_display_itemcspddlm}jdur gStjttfstddddSjj|jur6tt fdd t jDSgS) zK Check that list_display_links is a unique subset of list_display. r) ModelAdminNza list, a tuple, or Nonelist_display_linksz admin.E110rUc3rz)zlist_display_links[%d]N)_check_list_display_links_itemrYr\rrr. r|z=ModelAdminChecks._check_list_display_links..) rrrr4r^r_r`get_list_display__func__rrarb)rPrWrrr\rrs   z*ModelAdminChecks._check_list_display_linkscCs*||jvrtjd||f|jddgSgS)NzIThe value of '%s' refers to '%s', which is not defined in 'list_display'.z admin.E111rh)rrr2rurrrrrs  z/ModelAdminChecks._check_list_display_links_itemcrR)NrS list_filterz admin.E112rUc3rz)zlist_filter[%d]N)_check_list_filter_itemrr\rrr.$r|z6ModelAdminChecks._check_list_filter..)r4rr^r_r`rrarbrcrr\rr s  z#ModelAdminChecks._check_list_filterc Csddlm}m}t|r2t|tjs2t||std||ddSt ||r0t j d||j ddgSgSt|t tfrN|\}}t||sLtd d ||d dSgS|}z t|j|WgSttfyrt j d ||f|j d dgYSw)aG Check one item of `list_filter`, i.e. check if it is one of three options: 1. 'field' -- a basic field filter, possibly w/ relationships (e.g. 'field__rel') 2. ('field', SomeFieldListFilter) - a field-based list filter class 3. SomeListFilter - a non-field list filter class r)FieldListFilter ListFilterrz admin.E113rz:The value of '%s' must not inherit from 'FieldListFilter'.z admin.E114rhrrz admin.E115zBThe value of '%s' refers to '%s', which does not refer to a Field.z admin.E116)django.contrib.adminrrrr4r Fieldrrrrr2rur_r^rrirr )rPrWrrwrrrflist_filter_classrrrr)s>     z(ModelAdminChecks._check_list_filter_itemcCs&t|jtttfstdd|ddSgS)zA Check that list_select_related is a boolean, a list or a tuple. za boolean, tuple or listlist_select_relatedz admin.E117rU)r4rrr^r_r`rcrrrr\sz+ModelAdminChecks._check_list_select_relatedcCr)z) Check that list_per_page is an integer. an integer list_per_pagez admin.E118rU)r4rintr`rcrrrrd z%ModelAdminChecks._check_list_per_pagecCr)z- Check that list_max_show_all is an integer. rlist_max_show_allz admin.E119rU)r4rrr`rcrrrrlrz)ModelAdminChecks._check_list_max_show_allcrR)zl Check that list_editable is a sequence of editable fields from list_display without first element. rS list_editablez admin.E120rUc3rz)zlist_editable[%d]N)_check_list_editable_itemrr\rrr.{r|z8ModelAdminChecks._check_list_editable..)r4rr^r_r`rrarbrcrr\rrtrdz%ModelAdminChecks._check_list_editablec Csz |jj|}Wntyt|||ddYSw||jvr.tjd||f|jddgS|j rB||j vrBtjd||jddgS|jd|krb|j sb|j durbtjd ||jdf|jd dgS|j sstjd ||f|jd dgSgS) Nz admin.E121rezKThe value of '%s' refers to '%s', which is not contained in 'list_display'.z admin.E122rhzMThe value of '%s' cannot be in both 'list_editable' and 'list_display_links'.z admin.E123rz~The value of '%s' refers to the first field in 'list_display' ('%s'), which cannot be used unless 'list_display_links' is set.z admin.E124zJThe value of '%s' refers to '%s', which is not editable through the admin.z admin.E125) rirjrkr rlrrr2rureditabler}rrrrsT      z*ModelAdminChecks._check_list_editable_itemcCs$t|jttfstdd|ddSgS)z$ Check search_fields is a sequence. rSrvz admin.E126rU)r4rvr^r_r`rcrrrrsz%ModelAdminChecks._check_search_fieldsc Cs||jdurgSz t|j|jd}Wnttfy*tjd|j|jddgYSwt|t j t j fs_permission() method for each permission. allowed_permissionszhas_%s_permissionz/%s must define a %s() method for the %s action.z admin.E129rh)_get_base_actionsrrr1rr2rurs) rPrWactionsr'funcr_ permission method_namerrrrs,   z1ModelAdminChecks._check_action_permission_methodscCs^g}tdd|D}|D]\}}|dkr,|tjd|jj|f|jddq|S)z.Check that every action has a unique __name__.css|]\}}}|VqdSr+r)r-rrrrrr.sz=ModelAdminChecks._check_actions_uniqueness..rzS__name__ attributes of actions defined in %s must be unique. Name %r is not unique.z admin.E130rh) collectionsCounterrrr1rr2rurs)rPrWr'namesrcountrrrrs z*ModelAdminChecks._check_actions_uniqueness)rsrrr$rrrrrrrrrrrrrrrrrrr __classcell__rrrrr~s*    $ ! 3 2rcsPeZdZfddZfddZddZddZd d Zd d Zd dZ Z S)InlineModelAdminChecksc sV|j}gt|||||||||||||||Sr+) parent_modelrr$_check_relation_check_exclude_of_parent_model _check_extra_check_max_num_check_min_num_check_formset)rP inline_objr&rrrrr$s    zInlineModelAdminChecks.checkcsvt|}|r gS|||rgS|jdurgSt||j|jd}|j|jvr9tj d|j|j j f|j ddgSgS)Nfk_namezVCannot exclude the field '%s', because it is the foreign key to the parent model '%s'.z admin.E201rh) rrFrrrrirrrr2rjrwru)rPrWrr'fkrrrr s&      z5InlineModelAdminChecks._check_exclude_of_parent_modelc CsXz t||j|jdWgSty+}ztj|jd|jddgWYd}~Sd}~ww)Nrrz admin.E202rh)rrir ValueErrorrr2argsru)rPrWrerrrr(s&z&InlineModelAdminChecks._check_relationcCr)z! Check that extra is an integer. rextraz admin.E203rU)r4rrr`rcrrrr0rz#InlineModelAdminChecks._check_extracC.|jdurgSt|jtstdd|ddSgS)z# Check that max_num is an integer. Nrmax_numz admin.E204rU)rr4rr`rcrrrr8  z%InlineModelAdminChecks._check_max_numcCr)z# Check that min_num is an integer. Nrmin_numz admin.E205rU)r r4rr`rcrrrrBrz%InlineModelAdminChecks._check_min_numcCr)z2 Check formset is a subclass of BaseModelFormSet. rformsetz admin.E206r)rr!rrrcrrrrLrz%InlineModelAdminChecks._check_formset) rsrrr$rrrrrrr rrrrr s    r cCtjd||f|j|dgS)NzThe value of '%s' must be %s.rhrr2ru)rtrVrWr*rrrr`U  r`cCr")Nz)The value of '%s' must inherit from '%s'.rhr#rrrrr_r$rcCs$tjd|||jjjf|j|dgS)NzDThe value of '%s' refers to '%s', which is not an attribute of '%s'.rh)rr2rirjrwrurerrrrlisrl))r itertoolsr django.appsr django.confrdjango.contrib.admin.utilsrrr django.corerdjango.core.exceptionsr django.dbr django.db.models.constantsr django.db.models.expressionsr django.forms.modelsr rrdjango.templaterdjango.template.backends.djangordjango.utils.module_loadingrrrr)r@rArr r`rrlrrrrs<            XoX