No subject


Thu Oct 25 19:26:07 UTC 2012


ema to import from another CKAN as the data-objects are already in the righ=
t form.</div><div style=3D"color:rgb(34,34,34);font-size:13px;font-family:a=
rial,sans-serif">

<br></div><div style=3D"color:rgb(34,34,34);font-size:13px;font-family:aria=
l,sans-serif">Thanks!</div><div style=3D"color:rgb(34,34,34);font-size:13px=
;font-family:arial,sans-serif">
Michael</div><div style=3D"color:rgb(34,34,34);font-size:13px;font-family:a=
rial,sans-serif"><br></div></div></div><div style=3D"color:rgb(34,34,34);fo=
nt-size:13px;font-family:arial,sans-serif"><div><div class=3D"h5">
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>class DgvatF=
orm(SingletonPlugin):</div><div>=C2=A0 =C2=A0 implements(IRoutes)</div><div=
>=C2=A0 =C2=A0 implements(IConfigurer)</div><div>=C2=A0 =C2=A0 implements(I=
GenshiStreamFilter)</div><div>=C2=A0 =C2=A0 implements(IDatasetForm)</div>

<div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 log.fatal(&quot;Enter: %s&=
quot; % __name__)</div><div>=C2=A0 =C2=A0 def package_form(self):</div><div=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return &#39;package/datagvat_organization_form=
.html&#39;</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0=C2=A0</div=
><div>

=C2=A0 =C2=A0 def before_map(self, map):</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 map.connect(&#39;/error/{action}&#39;, controller=3D&#39;ckanext.dgvat_=
por.controllers.data_gv_at:DgvatErrorController&#39;)</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 map.connect(&#39;/error/{action}/{id}&#39;, controller=3D=
&#39;ckanext.dgvat_por.controllers.data_gv_at:DgvatErrorController&#39;) =
=C2=A0 =C2=A0 =C2=A0 =C2=A0</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 map.connect(&#39;/dataset/new&#39;, controller=3D&#39;ckanext.dgvat_por=
.controllers.data_gv_at:DgvatPackageController&#39;, action=3D&#39;new&#39;=
)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/dataset/edit/{id}=
&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.data_gv_at:DgvatPack=
ageController&#39;, action=3D&#39;edit&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/dataset/{id}.{format}&#3=
9;, controller=3D&#39;ckanext.dgvat_por.controllers.data_gv_at:DgvatPackage=
Controller&#39;, action=3D&#39;read&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 map.connect(&#39;/dataset/{id}&#39;, controller=3D&#39;ckanext.dgvat=
_por.controllers.data_gv_at:DgvatPackageController&#39;, action=3D&#39;read=
&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/dataset/{id}/resource/{r=
esource_id}&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.data_gv_a=
t:DgvatPackageController&#39;, action=3D&#39;resource_read&#39;)</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/dataset/{id}/resource/{resour=
ce_id}/embed&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.data_gv_=
at:DgvatPackageController&#39;, action=3D&#39;resource_embedded_dataviewer&=
#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/dataset/editresources/{i=
d}&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.data_gv_at:DgvatPa=
ckageController&#39;, action=3D&#39;editresources&#39;)</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/user/edit/{id:.*}&#39;, controller=
=3D&#39;ckanext.dgvat_por.controllers.dgvat_user:DgvatUserController&#39;, =
action=3D&#39;edit&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #m.connect(&#39;/user/reset/{id:.*}&#39;, =
action=3D&#39;perform_reset&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map=
.connect(&#39;/user/register&#39;, controller=3D&#39;ckanext.dgvat_por.cont=
rollers.dgvat_user:DgvatUserController&#39;, action=3D&#39;register&#39;)</=
div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/user/login&#39;, control=
ler=3D&#39;ckanext.dgvat_por.controllers.dgvat_user:DgvatUserController&#39=
;, action=3D&#39;login&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.conn=
ect(&#39;/user/_logout&#39;, &#39;/user/logout&#39;, controller=3D&#39;ckan=
ext.dgvat_por.controllers.dgvat_user:DgvatUserController&#39;, action=3D&#3=
9;logout&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/user/logged_in&#39;, con=
troller=3D&#39;ckanext.dgvat_por.controllers.dgvat_user:DgvatUserController=
&#39;, action=3D&#39;logged_in&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
map.connect(&#39;/user/logged_out&#39;, controller=3D&#39;ckanext.dgvat_por=
.controllers.dgvat_user:DgvatUserController&#39;, action=3D&#39;logged_out&=
#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/user/logged_out_redirect=
&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgvat_user:DgvatUser=
Controller&#39;, action=3D&#39;logged_out_page&#39;)</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 #map.connect(&#39;/user/reset&#39;, action=3D&#39;request=
_reset&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #m.connect(&#39;/user/me&#39;, action=3D&#=
39;me&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/user/se=
t_lang/{lang}&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgvat_u=
ser:DgvatUserController&#39;, action=3D&#39;set_lang&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #m.connect(&#39;/user/{id:.*}&#39;, action=
=3D&#39;read&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;/=
user&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgvat_user:Dgvat=
UserController&#39;, action=3D&#39;index&#39;) =C2=A0 =C2=A0 =C2=A0 =C2=A0<=
/div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 map.connect(&#39;home&#39;, &#39;/&#39;, controller=3D&#39;ckanext.dgva=
t_por.controllers.dgvat_cockpit:DgvatCockpitController&#39;, action=3D&#39;=
search&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;about&#=
39;, &#39;/about&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgva=
t_cockpit:DgvatCockpitController&#39;, action=3D&#39;about&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;terms&#39;, &#39;/terms&#=
39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgvat_cockpit:DgvatCoc=
kpitController&#39;, action=3D&#39;terms&#39;)</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 map.connect(&#39;help&#39;, &#39;/help&#39;, controller=3D&#39;c=
kanext.dgvat_por.controllers.dgvat_cockpit:DgvatCockpitController&#39;, act=
ion=3D&#39;help&#39;)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 map.connect(&#39;register_api&#39;, &#39;/=
register_api&#39;, controller=3D&#39;ckanext.dgvat_por.controllers.dgvat_co=
ckpit:DgvatCockpitController&#39;, action=3D&#39;register&#39;)</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #lo=
g.fatal(&quot;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D&gt; %s&quot; % map)</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return map</div><div>=C2=A0 =C2=A0=C2=A0</=
div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 def after_map(self, ma=
p):</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #log.fatal(&quot;=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D&gt; %s&quot; % map)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 retu=
rn map</div><div>

=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 d=
ef update_config(self, config):</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.d=
ebug(&quot;update_config&quot;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 confi=
g[&#39;package_form&#39;] =3D &#39;data_gv_at&#39;</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 configure_template_directory(config, &#39;templates&#39;)</di=
v>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 configure_public_directory(config, &#39;pu=
blic&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 def filter(self, stream):</=
div><div><br></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 from pylons import requ=
est, tmpl_context as c</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 routes =3D request.environ.get(&#39;pylons=
.routes_dict&#39;)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.debug(routes)<=
/div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if routes and \</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0routes.get(&#39;controller&#39=
;) =3D=3D &#39;package&#39; and \</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0routes.get(&#39=
;action&#39;) =3D=3D &#39;read&#39; and=C2=A0<a href=3D"http://c.pkg.id/" s=
tyle=3D"color:rgb(17,85,204)" target=3D"_blank">c.pkg.id</a>:</div><div><br=
></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Add dataset id to t=
he UI</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stream =3D stream_filters.pa=
ckage_id_filter(stream, c.pkg)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return=
 stream</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0=C2=A0</div><d=
iv>=C2=A0 =C2=A0 def setup_template_variables(self, context, data_dict):</d=
iv><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.debug(&quot;setup_template_variable=
s&quot;)</div>

<div><br></div><div>=C2=A0 =C2=A0 def package_types(self):</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 return [&#39;dataset&#39;]</div><div>=C2=A0 =C2=A0=C2=
=A0</div><div>=C2=A0 =C2=A0 def is_fallback(self):</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 return True =C2=A0</div><div><br></div><div>=C2=A0 =C2=A0 def=
 form_to_db_schema(self):</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.fatal(&quot;Enter form to db!!!&quot;)=
</div><div><div style=3D"margin:5px 0px"><div style=3D"color:rgb(80,0,80);f=
ont-size:11px;background-color:rgb(241,241,241);border:1px solid rgb(221,22=
1,221);clear:both;line-height:6px;outline:none;width:20px">

<div style=3D"background-image:url(https://ssl.gstatic.com/ui/v1/icons/mail=
/ellipsis.png);min-height:8px;width:20px;background-repeat:no-repeat no-rep=
eat"></div></div></div></div></div></div><div class=3D"im"><div>=C2=A0 =C2=
=A0 def add_to_extras(self, key, data, errors, context):</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 # get current number of extras</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 extras =3D data.get((&#39;extras&#39;,), [])</d=
iv><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if not extras:</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 data[(&#39;extras&#39;,)] =3D extras</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 #extras.append({&#39;key&#39;: key[-1], &#39;va=
lue&#39;: data[key]})</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #log.fatal(&quot;add to extras: %s, %s&quo=
t; % (key, data[key]))</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #log.fatal(&qu=
ot;extra_number: %s&quot; % extra_number)</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 #data[(&#39;extras&#39;, extra_number, &#39;key&#39;)] =3D key[0]</d=
iv>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 cats =3D&quot;&quot;</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 allCat=3D[]</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 for cur=
 in data[key]:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if cur !=
=3D &#39;[&#39; and cur!=3D&#39;]&#39;:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cats +=3D cur</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 for cat_desc, id in c.categorization:</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if id in cats:</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 allCat.append(id) =C2=
=A0 =C2=A0 =C2=A0</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.fatal(&quot;add=
ed categorizations:id %s&quot; % allCat)</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 log.fatal(&quot;cats, key: %s,%s&quot; % (cats, data[key]))</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 log.fatal(&quot;is list: %s&quot; % isinst=
ance(data[key], list))</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 #data[(&#39;ex=
tras&#39;, extra_number, &#39;value&#39;)] =3D allCat</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 extras.append({&#39;key&#39;: key[-1], &#39;value&#39;: a=
llCat})</div>

<div><div style=3D"margin:5px 0px"><div style=3D"color:rgb(80,0,80);font-si=
ze:11px;background-color:rgb(241,241,241);border:1px solid rgb(221,221,221)=
;clear:both;line-height:6px;outline:none;width:20px">
<div style=3D"background-image:url(https://ssl.gstatic.com/ui/v1/icons/mail=
/ellipsis.png);min-height:8px;width:20px;background-repeat:no-repeat no-rep=
eat"></div></div></div></div></div><div class=3D"im"><div>=C2=A0 =C2=A0 def=
 read_template(self):</div>

<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return &#39;package/read.html&#39;</div><d=
iv><br></div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 def check_dat=
a_dict(self, schema=3DNone):</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return</=
div><div><br></div><div>=C2=A0 =C2=A0 def new_template(self):</div><div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return &#39;package/new.html&#39;</div>
<div><br></div><div>=C2=A0 =C2=A0 def comments_template(self):</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return &#39;package/comments.html&#39;</div><di=
v><br></div><div>=C2=A0 =C2=A0 def search_template(self):</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 return &#39;package/search.html&#39;</div>

<div><br></div><div>=C2=A0 =C2=A0 def read_template(self):</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 return &#39;package/read.html&#39;</div><div><br></di=
v><div>=C2=A0 =C2=A0 def history_template(self):</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 return &#39;package/history.html&#39;</div>
<div>
<br></div><div>=C2=A0 =C2=A0 def package_form(self):</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 return &#39;package/datagvat_organization_form.html&#39;<=
/div></div></div><br></div>
</blockquote></div><br></div>

--90e6ba1efca050ccb304d390950b--



More information about the ckan-dev mailing list