Parent: [77e4cc] (diff)

Child: [244009] (diff)

Download this file

views.pyc    53 lines (53 with data), 9.2 kB

ó
‡Ó­Sc@sŽddlmZddlmZddlmZmZddlmZm	Z	m
Z
mZddlm
Z
ddlmZmZddlmZddlmZdd	lmZmZmZdd
lmZmZmZmZmZddlm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&m'Z'd
d„Z(defd„ƒYZ)d„Z*d„Z+d„Z,d„Z-d„Z.d„Z/d„Z0d„Z1dS(i˙˙˙˙(tsettings(treverse(tHttpResponseRedirecttHttpResponse(trendertget_object_or_404trender_to_responsetredirect(tRequestContext(t
simplejsonttimezone(tListView(tminidom(tAnalysisFormtUploadFileFormtImportChoice(tAnalysist
ConfigurationtInstancetUploadedFiletAnswer(tMethodologytMethodologyVersiontQuestiontPage(t
xmlMinidomtTrivialJSONEncodertSearchEngineicCsĺ|jdkrvt|jƒ}|jƒr_|jƒ}tjƒ|_|jƒtt	dƒƒSt
|di|d6ƒS|dkrÁttd|ƒ}td|ƒ}t
|di|d6|d6ƒStƒ}t
|di|d6ƒSdS(	NtPOSTt
analysis_listsanalysis/analysis_new.htmltformitpktinstancetanalysis(
tmethodR
Rtis_validtsaveR
tnowtcreatedRRRRR(trequesttanalysis_idRtmodel_instanceR!((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytanalysis_news
	tAnalysisListcBs eZejjdƒZdZRS(s-createdt
analises_list(t__name__t
__module__Rtobjectstorder_bytquerysettcontext_object_name(((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pyR+"scBs—eed|ƒ}|jjj}d|jddUee||ƒƒedƒ}ee	||ƒƒedƒ}e
|di|d6|d6|d6ƒS(	NRsfrom s2.views import search_html_form, instance_list_htmls&Content-Type: text/html; charset=utf-8sanalysis/analysis_detail.htmlR!tanalysis_detailtsearch_html_ui(RRtmethodology_versiontmethodologytentitytactual_entity_apptstrtsearch_html_formtlentinstance_list_htmlR(R'R(R!R7R4R3((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytdetail&scBs{eed|ƒ}|jjj}d|jddUee||ƒƒedƒ}e	|di|d6|d6|jd6ƒS(	NRsfrom s2.views import search_html_form, instance_list_htmls&Content-Type: text/html; charset=utf-8s analysis/analysis_questions.htmlR!R3R5(
RRR5R6R7R8R9R<R;R(R'R(R!R7R3((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytanalysis_questions1s
cCs'yÖ|jjddƒ}|jjddƒ}|jjddƒ}|jjddƒ}ytjjd|d|ƒ}Wn@tƒ}tjjd|ƒ|_tjjd|ƒ|_nX||_||_	|j
ƒWn-tk
r}tt
ji|jd6ƒƒSXtt
jid	d6|d6ƒƒS(
Ntquestion_idttid_selected_instancetvaluetnotestinstance_idRtresponsetOK(RtgetRR/RR Rtquestiont
value_integerRCR$t	ExceptionRR	tdumpstmessage(R'R?RARBRCtatex((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytsave_answer<s"			cCsF|jjddƒ}tjjd|ƒ}ttƒjt|ƒƒƒS(Ntid_instanceR@RD(	tGETRGRR/tfilterRRtencodetlist(R'RPtanswers((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytget_answersQscBsŰg}|jjddƒ}ejjd|ƒ}|jjjj}g}ejj	d|jjƒ}x|D]}||j
ƒ7}qjW|jjƒ}x)|D]!}	d}
d}|	j
dU|	jdUxÂ|	jjƒD]ą}d}
|jGH|jdU|GH|jGH|jdU|
GHeej||
ƒƒ}ej||
ƒ}d|GHejƒ}|
d|dej||
ƒd	|d
|d7}
qŇWi}|	j|d<|
|d
<||d<|j|ƒqšWeeƒje|ƒƒƒS(NRPR@RR5i˙˙˙˙sget_metadata search_url: s<a target='_blank' href='s'>'s' on s: (s results)</a><br>R?tdescriptionRB(RQRGRR/R!R5R6R7RRRt	questionstactual_instancetgetInstanceInfoteval_descriptiont
eval_valuet	query_settallt	eval_textt	eval_siteR9Rtsearch_countt
search_urltsearch__engine_nametreadable_querytidtappendRRRSRT(R'tmetadataRPR R7tlist_of_questionstpagestpagetiRHRWRBtquerytsitetqRaRbtsearch_engine_name((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytget_metadataVsB

	:


cCsVttd|ƒ}|j}d|jƒ|jƒd}t|di|d6ddƒS(NRs	<osseval>s
</osseval>sanalysis/export.xmltxmltcontent_typesapplication/xhtml+xml(RRR5tto_xmlR(R'R(RMtmvtexported_xml((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytexportƒs	cCs¤d}|jdkrtt|j|jƒ}|jƒr}|jdjƒ}td|jdƒ}|jƒyßtj	|ƒ}t
ƒ}|jdƒ}t|dj
djjƒ|_|dj
djj|_|dj
d	jj|_|dj
d
jj|_t
ƒ}yt
jjd|jƒ}WnnXtƒ}	tƒ}
|	|
_|jdƒ}tj|dƒ|
_|dj
d
jj|
_|djdƒ}tj|dƒ|	_|dj
djj|	_|
|_tdi|jd6|jjd6ƒ}
t |di|j!ddƒd6|jdd6|d6|d6|d6|
d6ƒSWqqt"k
rm}dt#|ƒ}qqXq}n	tƒ}t$di|d6|d6dt%|ƒƒS(NR@RtfiletdocfileRitIdtNametCreatedt	UserLoginRRtNumberRtinitialtuploaded_file_idtnew_uploaded_file_relpathsanalysis/import_file.htmltindents    t	prettyxmltanalysis_on_filetanalysis_on_dbtnew_uploaded_filetimport_choice_formsError parsing uploaded file: sanalysis/upload_page.htmlRRLtcontext_instance(&R"RRtFILESR#treadRR$RtparseStringRtgetElementsByTagNametintt
attributest
firstChildtdataRetnameR&t
user_loginR/RGRRR6RtgetNaturalAttributetnumberR5RRxturlRttoprettyxmlRJR9RR(R'RLRtxml_uploadedR…txmldocRƒtanalysis_xmlR„tmethodology_on_filetmethodology_version_on_filetmethodology_version_xmltmethodology_xmlR†RN((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytupload_page‹sH
	 					&Q	cCsb|jd}t|jjddƒƒdk}|jjddƒ}|jjddƒ}ttjd|dƒ}|jƒ}WdQXtj|ƒ}|j	d	ƒd
}t
ƒ}	|rË|	j||ƒn|jdj
j|	_tƒ}
|	|
_|j	dƒd
}|r8|
j||ƒttd
d|
jfƒƒS|jdj
j|
_ttdƒƒSdS(NR€t
how_to_importR@itimport_methodologytimport_analysist/trRiRyRR3targsR(RRŒRGtopenRtBASE_DIRR‰RRŠR‹Rtfrom_xmlRRŽRReRR5RR(R'R€t
always_insertRŸR tcontent_fileR–R—R›RtRMR˜((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pytperform_importˇs(
!			N(2tdjango.confRtdjango.core.urlresolversRtdjango.httpRRtdjango.shortcutsRRRRtdjango.templateRtdjango.utilsR	R
tdjango.views.genericRtxml.domRtformsR
RRtanalysis.modelsRRRRRtmethodology.modelsRRRRt
OSSEval.utilsRRRR*R+R=R>RORVRpRvRRŠ(((sH/media/discoc/Dati/Lavoro/PROSE/Lavoro/OSSEval/OSSEval/analysis/views.pyt<module>s*"("					-		,