Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Michael Howitz

Am 03.03.2009 um 21:53 schrieb Massimiliano della Rovere:
What is the best way to represent a foreign key? a  
persistent.wref? an intid number?


Suppose I have a persistent class representing an art object author  
(A) and another persistent class representing an art object (B).


If I want to create links from one instance of one A to instances of  
class B (and vice versa) what do you recommend me?



It would be great having the possibility of referring attributes and  
methods of the object:
is w is a reference to an instance of A, w.name and w.surname for  
example...


You might have a look at http://pypi.python.org/pypi/gocept.reference

Yours sincerely,
--
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Massimiliano della Rovere
Thank you Michael!

On Wed, Mar 4, 2009 at 09:13, Michael Howitz m...@gocept.com wrote:

 Am 03.03.2009 um 21:53 schrieb Massimiliano della Rovere:

 What is the best way to represent a foreign key? a persistent.wref? an
 intid number?

 Suppose I have a persistent class representing an art object author (A) and
 another persistent class representing an art object (B).

 If I want to create links from one instance of one A to instances of class
 B (and vice versa) what do you recommend me?


 It would be great having the possibility of referring attributes and
 methods of the object:
 is w is a reference to an instance of A, w.name and w.surname for
 example...


 You might have a look at http://pypi.python.org/pypi/gocept.reference

 Yours sincerely,
 --
 Michael Howitz · m...@gocept.com · software developer
 gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
 http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
 Zope and Plone consulting and development




-- 
Se proprio dovete inserirmi in una mail in una
lista con indirizzi, vi prego di mettere il mio
nel campo CCN: o BCC: e non in TO: CC: oppure A:

skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_d...@hotmail.com

Mi scriva in italiano; Write me in English; Skribu al mi Esperante!

Volete farmi un regalo a natale e non sapete cosa? :D
http://www.boardgamegeek.com/collection/user/masdero?sort=wishlistsortdir=asccolumns=title|thumbnail|status|rating|bggrating|plays|comment|commandswishlist=1ff=1
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Michael Howitz
Am 04.03.2009 um 14:09 schrieb Massimiliano della Rovere:
 I have problems installing the package (I never did it before,  
 probably i do something wrong).
 I downloaded the package, decompressed it and run:
 sudo python setup.py build
   - ok
 sudo python setup.py install
   - error

You should use buildout to install dependencies for your application.  
As you already use Zope, there should be already a ZODB, so it needs  
not to be built at install of gocept.reference.

See http://pypi.python.org/pypi/zc.buildout or maybe
http://redomino.com/it/labs/documentazione/tutorial/gestire-progetti-con-zc-buildout/

 When installing, it tries to download an updated package about ZODB  
 but then it fails compiling it:

 python2.4 setup.py build
[...]
 src/BTrees/BTreeModuleTemplate.c:15:20: error: Python.h: Nessun file  
 o directory

Google finds this: 
http://www.mail-archive.com/plone...@lists.plone.org/msg02411.html 
  (sounds a bit similar especially because I do not understand  
Italian :)


Yours sincerely,
-- 
Michael Howitz · m...@gocept.com · software developer
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Best way to represent a foreign key in ZODB

2009-03-04 Thread Massimiliano della Rovere
Thank you I solved the problem.
I was missing the

build-essential
python2.4-dev

packages. Since they were not installed I received the errors.


On Wed, Mar 4, 2009 at 14:53, Michael Howitz m...@gocept.com wrote:

 Am 04.03.2009 um 14:09 schrieb Massimiliano della Rovere:

 I have problems installing the package (I never did it before, probably i
 do something wrong).
 I downloaded the package, decompressed it and run:
 sudo python setup.py build
  - ok
 sudo python setup.py install
  - error


 You should use buildout to install dependencies for your application. As
 you already use Zope, there should be already a ZODB, so it needs not to be
 built at install of gocept.reference.

 See http://pypi.python.org/pypi/zc.buildout or maybe

 http://redomino.com/it/labs/documentazione/tutorial/gestire-progetti-con-zc-buildout/

  When installing, it tries to download an updated package about ZODB but
 then it fails compiling it:

 python2.4 setup.py build

 [...]

 src/BTrees/BTreeModuleTemplate.c:15:20: error: Python.h: Nessun file o
 directory


 Google finds this:
 http://www.mail-archive.com/plone...@lists.plone.org/msg02411.html (sounds
 a bit similar especially because I do not understand Italian :)



 Yours sincerely,
 --
 Michael Howitz · m...@gocept.com · software developer
 gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
 http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
 Zope and Plone consulting and development




-- 
Se proprio dovete inserirmi in una mail in una
lista con indirizzi, vi prego di mettere il mio
nel campo CCN: o BCC: e non in TO: CC: oppure A:

skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_d...@hotmail.com

Mi scriva in italiano; Write me in English; Skribu al mi Esperante!

Volete farmi un regalo a natale e non sapete cosa? :D
http://www.boardgamegeek.com/collection/user/masdero?sort=wishlistsortdir=asccolumns=title|thumbnail|status|rating|bggrating|plays|comment|commandswishlist=1ff=1
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users