[Cubicweb] Link or merge two instances?

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


Adrien

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

John

________________________________________
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?

Hi,

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).
Tél: 01.45.32.03.12
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
http://lists.cubicweb.org/mailman/listinfo/cubicweb


More information about the Cubicweb mailing list