[Cubicweb] Moving CW from 3.3.3 to 3.4.2

Nicolas Chauvat nicolas.chauvat at logilab.fr
Fri Aug 14 11:39:25 CEST 2009


Hola Carlos,

On Thu, Aug 13, 2009 at 08:46:33PM -0500, Carlos Balderas wrote:
> /usr/lib/python2.5/site-packages/cubicweb/selectors.py:1028:
> DeprecationWarning: use & operator (binary and)
>   accept = chainall(non_final_entity(), accept_rset, name='accept')
> /usr/lib/python2.5/site-packages/cubicweb/selectors.py:1033:
> DeprecationWarning: use & operator (binary and)
>   name='accept_one'))
> /usr/lib/python2.5/site-packages/cubicweb/selectors.py:1044:
> DeprecationWarning: use & operator (binary and)
>   name='rql_condition'))
> /usr/lib/python2.5/site-packages/cubicweb/selectors.py:1071:
> DeprecationWarning: use & operator (binary and)
>   name='searchstate_accept')
> /usr/lib/python2.5/site-packages/cubicweb/selectors.py:1075:
> DeprecationWarning: use & operator (binary and)
>   name='searchstate_accept_one')

These deprecation warnings will disappear with the next release of
cubicweb, do not worry about these ones for now.

> /var/lib/python-support/python2.5/yams/reader.py:114: DeprecationWarning:
> module for /home/carlos/lib/cubes/hotel/schema.py can't be found, add
> necessary __init__.py files to make it importable
>   'files to make it importable' % filepath, DeprecationWarning)
> 2009-08-13 20:12:01 - (cubicweb.sources.system) ERROR: no text index table

I suppose /home/carlos/lib/cubes/__init__.py or
.../lib/cubes/hotel/__init__.py is missing.

> In the other hand I'm using __rtags__ variable in AnyEntity class of my
> entity.py file, but I know now that this variable is Deprecated, what would
> be the correct way to make related attributes appear in the edition form
> (inlineview, primary, generated, etc)?

__rtags__ was replaced with uicfg.

Remember that the goal of __rtags__/uicfg is to make it easier to
develop user interfaces by leveraging the base views. Having
PrimaryView generate a nice view for any type of entity is difficult,
but annotating the schema with uicfg allows the developer to tell
PrimaryView how to display things (much) better... without writing
more than a few lines of code.

grepping the source of cubicweb and the cubes for uicfg will return
tons of examples. `grep -r uicfg cubicweb/ cubes/`

Here is an excerpt of what is found in the blog cube in views.py with
added comments:

from cubicweb.web import uicfg
# the title is hidden (because already displayed in entity_title()
uicfg.primaryview_section.tag_attribute(('Blog','title'), 'hidden')

# the rss_url is hidden (because we do not want it to appear in the
# attributes section handled by the primaryview mechanism)
uicfg.primaryview_section.tag_attribute(('Blog','rss_url'), 'hidden')

# the title is hidden, same as above
uicfg.primaryview_section.tag_attribute(('BlogEntry','title'),'hidden')

# the blog related to the blogentry is hidden
uicfg.primaryview_section.tag_object_of(('*','entry_of', 'Blog'), 'hidden')

# the entities linked to blogentry by the relation entry_of will be
# displayed in the section 'relations' of the primary view
uicfg.primaryview_section.tag_subject_of(('BlogEntry','entry_of','*'), 'relations')

# an action "add a XXX" will be added to the action box for Blogs
# where XXX is linked to Blog by the relation entry_of
uicfg.actionbox_appearsin_addmenu.tag_object_of(('*','entry_of', 'Blog'), True)

Please ask more questions if the above explanations are not enough.

-- 
Nicolas Chauvat

logilab.fr - services en informatique scientifique et gestion de connaissances  



More information about the Cubicweb mailing list