# HG changeset patch # User Sylvain Thenault # Date 1228497261 -3600 # Node ID a57548916045b411e593f686d85882e5dfce6613 # Parent 8bcebdb5f55d78611a4fa32726fad5e3b9d9a5dc# Parent a4a9e1a7e40f07a2131a64e82c3aae1f6eb71002 merge diff -r 8bcebdb5f55d -r a57548916045 common/mixins.py --- a/common/mixins.py Fri Dec 05 18:09:12 2008 +0100 +++ b/common/mixins.py Fri Dec 05 18:14:21 2008 +0100 @@ -95,6 +95,16 @@ path.reverse() return path + def iterparents(self): + def _uptoroot(self): + curr = self + while True: + curr = curr.parent() + if curr is None: + break + yield curr + return _uptoroot(self) + def notification_references(self, view): """used to control References field of email send on notification for this entity. `view` is the notification view. diff -r 8bcebdb5f55d -r a57548916045 doc/book/en/B022-schema-definition.en.txt --- a/doc/book/en/B022-schema-definition.en.txt Fri Dec 05 18:09:12 2008 +0100 +++ b/doc/book/en/B022-schema-definition.en.txt Fri Dec 05 18:14:21 2008 +0100 @@ -370,3 +370,17 @@ To compensate this problem, it is usually necessary, for such case, to use an action that reflects the schema permissions but which enables to check properly the permissions so that it would show up if necessary. + + +Updating your application with your new schema +`````````````````````````````````````````````` + +You have to get a shell on your application :: + + cubicweb-ctl shell moninstance + +and type :: + + add_entity_type('Personne') + +And restart your application! diff -r 8bcebdb5f55d -r a57548916045 doc/book/fr/03-02-create-instance.fr.txt --- a/doc/book/fr/03-02-create-instance.fr.txt Fri Dec 05 18:09:12 2008 +0100 +++ b/doc/book/fr/03-02-create-instance.fr.txt Fri Dec 05 18:14:21 2008 +0100 @@ -48,8 +48,8 @@ cubicweb-ctl newtemplate moncube # répondre aux questions - hg init moncube cd moncube + hg init hg add . hg ci @@ -65,6 +65,10 @@ effectivement utilisables lors de la création de la base (import_erschema('Moncomposant') ne fonctionne pas sinon). +FIXME - need example code :: + + __use__ = ('blog', 'file') + Création d'une instance de développement ======================================== diff -r 8bcebdb5f55d -r a57548916045 doc/book/fr/04-02-schema-definition.fr.txt --- a/doc/book/fr/04-02-schema-definition.fr.txt Fri Dec 05 18:09:12 2008 +0100 +++ b/doc/book/fr/04-02-schema-definition.fr.txt Fri Dec 05 18:14:21 2008 +0100 @@ -346,3 +346,16 @@ nécessaire dans tel cas d'utiliser une action reflétant les droits du schéma mais permettant de faire la vérification correctement afin qu'elle apparaisse bien le cas échéant. + +Mise à jour du schema +````````````````````` + +Il faut ensuite lancer son cubicweb en mode shell :: + + cubicweb-ctl shell moninstance + +Et taper :: + + add_entity_type('Personne') + +Et on relance l'application! diff -r 8bcebdb5f55d -r a57548916045 rset.py --- a/rset.py Fri Dec 05 18:09:12 2008 +0100 +++ b/rset.py Fri Dec 05 18:14:21 2008 +0100 @@ -59,10 +59,10 @@ def __repr__(self): if not self.rows: - return '' % self.rql + return '' % self.rql if not self.description: - return '' % (self.rql, '\n'.join(str(r) for r in self.rows)) - return '' % (self.rql, + return '' % (self.rql, '\n'.join(str(r) for r in self.rows)) + return '' % (self.rql, '\n'.join('%s (%s)' % (r, d) for r, d in zip(self.rows, self.description)))