[Cubicweb] Link or merge two instances?

Fletcher, John P j.p.fletcher at aston.ac.uk
Sun Dec 12 19:46:29 CET 2010


Thank you for this help.  I have got around to trying it out over the weekend.

I now have imported my cards into the second instance and 
I know they are there because the card id numbers make sense.
A new card created in the instance has the number after the last one created by pickle.

However, they do not show up in the web interface at all.

Do I need to reindex something and if so what is the command?

Thank you


From: cubicweb-bounces at lists.cubicweb.org [cubicweb-bounces at lists.cubicweb.org] On Behalf Of Adrien Di Mascio [adrien.dimascio at logilab.fr]
Sent: 06 December 2010 17:18
To: cubicweb at lists.cubicweb.org
Subject: Re: [Cubicweb] Link or merge two instances?


On 06/12/2010 17:55, Florent Cayré wrote:

> import pickle
> cards = pickle.load(file('/tmp/out.pickle'))
> for card in cards:
>    rql('INSERT Card C: C title %(title)s, C synopsis %(synopsis)s, C
> content %(content)s, C wikiid %(wikiid)s', card)

In that case, I would suggest to use create_entity for simplicty sake :

import pickle
for card in pickle.load(file('/tmp/out.pickle')):
    create_entity('Card', **card)

Just-nipticking-ly yours,
Adrien Di Mascio - LOGILAB, Paris (France).
Formations - http://www.logilab.fr/formations
Développements - http://www.logilab.fr/services
Gestion de connaissances - http://www.cubicweb.org/
Cubicweb mailing list
Cubicweb at lists.cubicweb.org

More information about the Cubicweb mailing list