PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  ]c@s dZddlmZddlZddlmZddlmZddlm Z ddl m Z edd Z d e fd YZd Zd efdYZde jfdYZdefdYZdefdYZedZdZdZdS(u Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. i(tunicode_literalsN(t namedtuple(t LOOKUP_SEP(ttree(t lru_cacheuPathInfou5from_opts to_opts target_fields join_field m2m directt InvalidQuerycBseZdZRS(uE The query passed to raw isn't a safe query to use with raw. (t__name__t __module__t__doc__(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRsccs<|Vx0|jD]"}xt|D] }|Vq%WqWdS(N(t__subclasses__t subclasses(tclstsubclasstitem((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR st QueryWrappercBs,eZdZeZdZdddZRS(u A type that indicates the contents are an SQL fragment and the associate parameters. Can be used to pass opaque data to a where-clause, for example. cCs|t|f|_dS(N(tlisttdata(tselftsqltparams((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt__init__.scCs|jS(N(R(Rtcompilert connection((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytas_sql1sN(RRRtFalsetcontains_aggregateRtNoneR(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR's tQcBseeZdZdZdZeZdZdZdZdZ dZ d e d e e dZRS( uf Encapsulates filters as objects that can then be combined logically (using `&` and `|`). uANDuORcOs3tt|jdt|t|jdS(Ntchildren(tsuperRRRtitems(Rtargstkwargs((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR?scCsZt|tst|nt|}||_|j|||j|||S(N(t isinstanceRt TypeErrorttypet connectortadd(Rtothertconntobj((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt_combineBs cCs|j||jS(N(R)tOR(RR&((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt__or__KscCs|j||jS(N(R)tAND(RR&((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt__and__NscCs0t|}|j||j|j|S(N(R#R%R,tnegate(RR(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt __invert__Qs cCs5|j||d|dt\}}|j||S(Nt allow_joinst split_subq(t_add_qRt promote_joins(RtqueryR0treuset summarizetfor_savetclausetjoins((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytresolve_expressionWs$ N(RRRR,R*tdefaultRR)R+R-R/RtTrueRR:(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR5s    tDeferredAttributecBs,eZdZdZddZdZRS(u A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed. cCs ||_dS(N(t field_name(RR>tmodel((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRdscCs|dkr|S|j}|j|j||kr|j||j}|dkr|jd|jgt||j}n|||jt_check_parent_chaintrefresh_from_dbtgetattr(RtinstanceR Rtval((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt__get__gs   cCsS|j}|j|}|j|j}|jrO||krOt||jSdS(u Check if the field value can be fetched from a parent field already loaded in the instance. This can be done if the to-be fetched field is a primary key field. N(t_metat get_fieldtget_ancestor_linkR?t primary_keyREtattnameR(RRFtnametoptstft link_field((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRCys  N(RRRRRRHRC(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR=_s  tRegisterLookupMixincBseZedZeedd dZdZdZe dZ edZ ed dZ ed dZ RS( cCs|jj|dS(N(t get_lookupsRBR(R t lookup_name((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt _get_lookupstmaxsizecCs>gtj|D]}|jjdi^q}|j|S(Nu class_lookups(tinspecttgetmroRARBt merge_dicts(R tparentt class_lookups((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRSs1cCsnddlm}|j|}|dkrJt|drJ|jj|S|dk rjt|| rjdS|S(Ni(tLookupu output_field(tdjango.db.models.lookupsR\RURthasattrt output_fieldt get_lookupt issubclass(RRTR\tfound((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyR`scCsnddlm}|j|}|dkrJt|drJ|jj|S|dk rjt|| rjdS|S(Ni(t Transformu output_field(R]RcRURR^R_t get_transformRa(RRTRcRb((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRdscCs.i}x!t|D]}|j|qW|S(u Merge dicts in reverse to preference the order of the original list. e.g., merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'. (treversedtupdate(tdictstmergedtd((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRYscCs(x!t|D]}|jjq WdS(N(R RSt cache_clear(R R ((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt_clear_cached_lookupsscCsN|dkr|j}nd|jkr3i|_n||j|<|j|S(Nu class_lookups(RRTRAR[Rk(R tlookupRT((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytregister_lookups     cCs&|dkr|j}n|j|=dS(un Remove given lookup from cls lookups. For use in tests only as it's not thread-safe. N(RRTR[(R RlRT((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyt_unregister_lookups  N(RRt classmethodRURRRSR`Rdt staticmethodRYRkRmRn(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyRRs   c Cs|js tS|jjr$| r$tS|rc|rF|j|krFtS| rc|j|krctSn| rw|jrwtS|r|j|kr|r|j|krtd|jj j |jfqqnt S(uv Returns True if this field should be used to descend deeper for select_related() purposes. Used by both the query construction code (sql.query.fill_related_selections()) and the model instance creation code (query.get_klass_info()). Arguments: * field - the field to be checked * restricted - a boolean field, indicating if the field list has been manually restricted using a requested clause) * requested - The select_related() dictionary. * load_fields - the set of fields to be loaded on this model * reverse - boolean, True if we are checking a reverse select related uXField %s.%s cannot be both deferred and traversed using select_related at the same time.( t remote_fieldRt parent_linktrelated_query_nameRNtnullRMRR?RIt object_nameR<(tfieldt restrictedt requestedt load_fieldstreverse((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytselect_related_descends" %cCsix\tt|dD]D}tj|d|!}||kr||r||||fSqWtdfS(u A helper method to check if the lookup_parts contains references to the given annotations set. Because the LOOKUP_SEP is contained in the default annotation names we must check each prefix of the lookup_parts for a match. ii((trangetlenRtjoinR(t lookup_partst annotationstntlevel_n_lookup((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytrefs_expressions cs=fd}||p<t|dto<||jjS(u Check that self.model is compatible with target_opts. Compatibility is OK if: 1) model and opts match (where proxy inheritance is removed) 2) model is parent of opts' model or the other way around cs=jj|jkp<|jjjkp<|jkS(N(RItconcrete_modeltget_parent_list(RO(R?(s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytchecksu primary_key(RERR?RI(R?t target_optsRvR((R?s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pytcheck_rel_lookup_compatibilitys (Rt __future__RRWt collectionsRtdjango.db.models.constantsRt django.utilsRtdjango.utils.lru_cacheRtPathInfot ExceptionRR tobjectRtNodeRR=RRRR{RR(((s@/usr/lib/python2.7/site-packages/django/db/models/query_utils.pyts   *(C $