ó È"ORc@s—ddlmZddlmZddlmZmZmZddlm Z ddl Tddl m Z ddl m Z m Z ddlmZmZdd lmZmZmZmZdd lmZdd lmZdd lmZdd lmZddlm Z dd lmZddlmZddlmZddlmZddl m Z ddl!m"Z"m#Z#m$Z$ddl%m&Z&ddl'Tddl(Tddl)m*Z*ddl+m,Z,ddl+m-Z-ddlmZmZmZddlmZddl.Td„Z/eddƒd„ƒZ0d„Z1d„Z2d„Z3d„Z4d„Z5d „Z6e&d!„ƒZ7d"„Z8e&d#„ƒZ9d$„Z:d%„Z;d&„Z<d'S((iÿÿÿÿ(tQ(tTemplateResponse(t authenticatetlogintlogout(tmessages(t*(tHttpResponseRedirect(Rt HttpResponse(tRequestContexttloader(tget_object_or_404trendertrender_to_responsetredirect(treverse(t ModelForm(tformset_factory(tCount(tauth(tlogin_required(tdatetime(t Paginatort InvalidPaget EmptyPage(t csrf_exempt(tUser(tUserCreationForm(tAuthenticationForm(RRRcCs¤|jdkrQt|jƒ}|jƒrZ|jƒtj|dƒtdƒSn tƒ}tdi|d6dd6dd 6dd 6dd 6dd 6dd 6dt |ƒƒS(NtPOSTsLote registrados/indexsRegistroEstatus.htmltformtactivet configuraciontclosedt no_activotregistro_revisiontactivotasignacion_activot devoluciontcontext_instance( tmethodt EstatusFormRtis_validtsaveRtsuccessRR R (trequestR((sC:\prometeo\registro\views.pytRegistroEstatus!s    t login_urls/registro/lote/cCs tjjƒjƒ}|dkr÷|jdkrrt|jƒ}|jƒr´|jƒt j |dƒt dƒSnBt j dtjjddƒƒtjdRtEquipoR8RUR9R@R6RRARttotalR5tchoiceR(t EquipoFormRR*t cleaned_dataR,R+RVtmessageRJtexcludet values_listR;R<RZR?R R R3(R-t listaEstatusRitestatusRevisionRDtloteCtmi_loteRktmuestraRevisiontEquiposRevisiontequiposRgtrRtxtyR[tultimaUbicacion((sC:\prometeo\registro\views.pytRegistroEquiposv(   '$                    )l  cCsØtjjƒjdƒd}tjjƒjdƒd}|jdkr‰t|jƒ}|jƒr’|jƒt j |dƒt dƒSn tƒ}t di|d6|j d6|d 6d d 6d d 6d d6dt|ƒƒS(Ns-numeroiRsCarta Porte registradas/registro/EquiposregistroCartaPorte.htmlRRBRSRR$R!R%R#R'(R6R7R8RUR(tCartaPorteFormRR*R+RR,RR RZR (R-RuRBR((sC:\prometeo\registro\views.pytRegistroCartaPorteís    cCs¤|jdkrQt|jƒ}|jƒrZ|jƒtj|dƒtdƒSn tƒ}tdi|d6dd6dd 6dd 6dd 6dd 6dd 6dt |ƒƒS(NRsPerfil registradas/indexsregistroPerfil.htmlRRR R!R"R#R$R%R&R'( R(t PerfilFormRR*R+RR,RR R (R-R((sC:\prometeo\registro\views.pytRegistroPerfilüs    cCsd}|jƒrÿ|jd}|dk rÿy•tjjddƒ}|jGHtjjd|d|ƒ}tjj d|jƒj ƒ}|dkr™d }nd}t d i|d 6d t |ƒƒSWqüt k rø}d }t d i|d 6d t |ƒƒSXqÿndS(NttqR1t Pendientet numero_serieR3t equipo_idiisverEquipo.htmlt resultadoR'i(tis_ajaxRtNoneR=R7R@RZRjt AsignacionR>R9R R RV(R-tresultsRiR3tid_eRaR[((sC:\prometeo\registro\views.pytVerificarEquipo s      $cCs·tjjƒjdƒdj}tjjd|ƒ}xlt|jdƒD]W}td|dddd d t d |ƒd t d|ƒd dd|ƒ}|j ƒqHWt dt |ƒƒS(Ns-numeroiReiR5tmarcatpatito1tmodelotquack1R…iÊš;Rdt estatus_iditlote_idsok %s( R6R7R8RURZR@RHRkRjtstrR+R(R-tpk_tlote1RNRy((sC:\prometeo\registro\views.pyttest$s  cCs$d}|jƒr |jd}|dk r y¶tjjd|ƒ}tjjd|jƒj ƒ}t jjddƒ}|dkr‹d}n5d}tjjd|jƒj ƒ||_ |j ƒtd i|d 6d t|ƒƒSWqtk r}d }td i|d 6d t|ƒƒSXq ndS( NR‚RƒR…R†R1R„iiscancelarajax.htmlRaR'i(RˆRR‰RjR7R@RŠR>RZR9R=tdeleteR3R+R R RV(R-R‹RiRŒR3RaR[((sC:\prometeo\registro\views.pytCancelarEquipo@s$       $cCsï|jdkr±t|jƒ}|jƒrº|jd}yNtjjd|ƒ}tdi|d6dd6dd6dd 6d t |ƒƒSWq®t k rª}t j |d ƒq®Xqºn tƒ}td i|d 6dd6dd6dd 6d t |ƒƒS(NRRiR…s Equipo.htmlRR$R!R%R#R'sEquipo No existesmostrarEquipo.htmlR( R(tEquipoBusquedaRR*RnRjR7R@R R RVRRW(R-RtserieRiR[((sC:\prometeo\registro\views.pyt mostrarEquipo^s  9 cCsátjjd|ƒ}|jdkr™t|jd|ƒ}|jƒrÝy(|jƒtj |dƒt dƒSWq–t k r’}tj |dƒq–XqÝnDtd|ƒ}t di|d6d d 6d d 6d d 6dt|ƒƒSdS(NReRtinstancesEquipo Editados/registro/buscarsError al Editar el equipos editarE.htmlRRR$R!R%R#R'(RjR7R@R(t EditarFormRR*R+RR,RRVRAR R (R-R†RiRR[((sC:\prometeo\registro\views.pyt editarEquipovs  c Cs|jdkr2t|jƒ}t|jƒ}t|jƒ}|jƒrM|jƒrM|jƒrM|jd}|jd}|jd}tjj d|ƒ}|GH|j ƒ}t jj ƒj d|jƒ}||_t|jdƒƒ|_|j ƒtd|d|ƒ} | j ƒtj|d ƒtd ƒSntƒ}tƒ}tƒ}i|d 6|d6|d 6} td | dt|ƒƒS(NRtNombretApellidotperfilR1Resutf-8tusersUsuario Registrados/registro/registrarUsuario/t formulariotdatossregistro_usuario.htmlR'(R(RRt FormDatost FormPerfilR*RntPerfilR7R>R+RR8R@RZt first_nameR”tencodet last_nametPersona_perfilRR,RR R ( R-R¤R¥R¢R1tapellidotid_ptusuario_tconsulta_usuarioRNtcontexto((sC:\prometeo\registro\views.pytregistrarUsuarioŠs0$           N(=tdjango.db.modelsRtdjango.template.responseRtdjango.contrib.authRRRtdjango.contribRtregistro.formst django.httpRRtdjango.templateR R tdjango.shortcutsR R R Rtdjango.core.urlresolversRt django.formsRtdjango.forms.formsetsRRRtdjango.contrib.auth.decoratorsRRtdjango.core.paginatorRRRtdjango.views.decorators.csrfRtasignacion.viewstrandomtdjango.contrib.auth.modelsRtdjango.contrib.auth.formsRRtasignacion.modelsR.RBRRR]R_R}RRRR—R™RœRŸR²(((sC:\prometeo\registro\views.pytsT "    .   `