Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-12 Thread Daniel Fetchinson
>> > I assume you have a reason not to use: >> > >> > class x(SQLObject): >> > ys = ForeignKey( 'y' ) >> >> Well, in the real life example I have the two objects 'x' and 'y' are >> kinda like 'article' and 'tag'. A tag can be attached to several >> articles and an article can have several tags

Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-11 Thread Oleg Broytman
On Mon, Nov 11, 2013 at 09:57:53AM +0100, Daniel Fetchinson wrote: > On 11/11/13, Simon Cross wrote: > > I assume you have a reason not to use: > > > > class x(SQLObject): > > ys = ForeignKey( 'y' ) > > Well, in the real life example I have the two objects 'x' and 'y' are > kinda like 'arti

Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-11 Thread Daniel Fetchinson
On 11/11/13, Simon Cross wrote: > I assume you have a reason not to use: > > class x(SQLObject): > ys = ForeignKey( 'y' ) Well, in the real life example I have the two objects 'x' and 'y' are kinda like 'article' and 'tag'. A tag can be attached to several articles and an article can have sev

Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-11 Thread Daniel Fetchinson
>> Perhaps it is by design but I was kind of surprised to see that if I have >> >> class x(SQLObject): >> ys = RelatedJoin( 'y' ) >> >> class y(SQLObject): >> >> >> then I'm allowed to add several times the same 'y' object to 'x' via >> >> myx = x.get( 1 ) >> myy = y.get( 1 ) >> x.addY

Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-10 Thread Simon Cross
I assume you have a reason not to use: class x(SQLObject): ys = ForeignKey( 'y' ) ? -- November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore tec

Re: [SQLObject] RelatedJoin allows adding item several times

2013-11-10 Thread Oleg Broytman
Hi! On Sun, Nov 10, 2013 at 10:21:21PM +0100, Daniel Fetchinson wrote: > Perhaps it is by design but I was kind of surprised to see that if I have > > class x(SQLObject): > ys = RelatedJoin( 'y' ) > > class y(SQLObject): > > > then I'm allowed to add several times the same 'y' ob

Re: [SQLObject] RelatedJoin

2008-05-17 Thread Oleg Broytmann
On Sat, May 17, 2008 at 07:24:57PM +0200, Luis Javier Peris wrote: > Thanks for the accurate answer, it have a lot of sense to have an add method > but I didn't know that it existed. > > 2008/5/17 Oleg Broytmann <[EMAIL PROTECTED]>: > > term.addQuestion(q) > > > > or > > > > q.addTerm(term)

Re: [SQLObject] RelatedJoin

2008-05-17 Thread Luis Javier Peris
Thanks for the accurate answer, it have a lot of sense to have an add method but I didn't know that it existed. 2008/5/17 Oleg Broytmann <[EMAIL PROTECTED]>: > On Sat, May 17, 2008 at 01:59:03AM +0200, Luis Javier Peris wrote: > > 'm working with SQLObject and I'm getting frustated because of lac

Re: [SQLObject] RelatedJoin

2008-05-17 Thread Luis Javier Peris
Thanks for the example. 2008/5/17 Luke Opperman <[EMAIL PROTECTED]>: > > First off, let me say I feel RelatedJoin and MultipleJoin should be > deprecated > to be renamed RawRelatedJoin/RawMultipleJoin, there are two better > alternatives > available since at least 0.8: > * SQLRelatedJoin and SQL

Re: [SQLObject] RelatedJoin

2008-05-17 Thread Oleg Broytmann
On Sat, May 17, 2008 at 01:59:03AM +0200, Luis Javier Peris wrote: > 'm working with SQLObject and I'm getting frustated because of lack of > examples. First of all, I'm having problems creating tables with > many-many relationships > by means of RelatedJoin. I want to create and know how work the

Re: [SQLObject] RelatedJoin

2008-05-16 Thread Luke Opperman
First off, let me say I feel RelatedJoin and MultipleJoin should be deprecated to be renamed RawRelatedJoin/RawMultipleJoin, there are two better alternatives available since at least 0.8: * SQLRelatedJoin and SQLMultipleJoin * ManyToMany and OneToMany Yes, the docs need a massive overhaul on

Re: [SQLObject] RelatedJoin!

2007-11-21 Thread Oleg Broytmann
On Wed, Nov 21, 2007 at 12:42:58PM +0100, Bert Wesarg wrote: > Is there an other 'join' I > should use for the case, where I only want in one class to get a > 'addRole' function, but not a 'addPerson' function? No. But if you don't need addPerson - just don't call it. add*s are symmetric, you m

Re: [SQLObject] RelatedJoin!

2007-11-21 Thread Bert Wesarg
On Nov 21, 2007 11:34 AM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, Nov 21, 2007 at 11:07:01AM +0100, Bert Wesarg wrote: > > Note, the only difference is the name of the second table. but in the > > second case the table 'bla_person' is not created. > >SQLObject sorts RelatedJoins tab

Re: [SQLObject] RelatedJoin!

2007-11-21 Thread Oleg Broytmann
On Wed, Nov 21, 2007 at 11:07:01AM +0100, Bert Wesarg wrote: > Note, the only difference is the name of the second table. but in the > second case the table 'bla_person' is not created. SQLObject sorts RelatedJoins tables alphabetically to avoid creating the same intermediate table twice... and

Re: [SQLObject] RelatedJoin to self ?

2007-09-14 Thread jonhattan
Fred C escribió: > Hi, > > I have a class User and I want to have a friends relation ship > between users in that table. > Is it possible to do it like in the snippet bellow. Is there a better > way to do it with SQLObject? > > I have tested this. and it works, but this construction doesn't fee

Re: [SQLObject] RelatedJoin order question

2007-08-06 Thread Oleg Broytmann
On Mon, Aug 06, 2007 at 03:24:28PM -0500, Jim Steil wrote: > class RailCategory(SQLObject): > class sqlmeta: > style = Style(longID=True) > idName = 'railCategoryId' > > name = UnicodeCol(length=50) > description = UnicodeCol() > railCars = RelatedJoin("RailCar",

Re: [SQLObject] RelatedJoin

2006-10-27 Thread marcelo schiavone
I before could not solve this problem. Directly I was defining: class centro(SQLObject): _connection=connection descripCentro=StringCol() practicas = RelatedJoin('practica') class practica(SQLObject): _connection=connection descripPractica=StringCol() valorTotalPractica=Fl

Re: [SQLObject] RelatedJoin

2006-10-26 Thread Rick Flosi
Ah, I should have mentioned that I use Postgres 7.x with this. I haven't used MySQL with this before. Were you able to resolve this? What was different? -- Rick On Thu, 26 Oct 2006, marcelo schiavone wrote: > Hola Rick > I did what you said to me. > Thank you all good worked. > > I worked with P

Re: [SQLObject] RelatedJoin

2006-10-26 Thread marcelo schiavone
Hola Rick I did what you said to me. Thank you all good worked. I worked with PostgreSQL 8.0.3 and MySQL 5.0. In PostgreSQL it worked correctly. In MySQL on having entered: " PracticaCentro.createTable () " It showed the following error: " ProgrammingError: (1064, " You have an mistake in your

Re: [SQLObject] RelatedJoin

2006-10-26 Thread marcelo schiavone
Thank you Rick. The 'createRelatedTable' did not work but I am looking for it. That advantages has the SQLRelatedJoin? Regards On 10/25/06, Rick Flosi <[EMAIL PROTECTED]> wrote: > > Add 'createRelatedTable=False' to your RelatedJoins like: > practica=RelatedJoin('practica', createRelatedTa

Re: [SQLObject] RelatedJoin

2006-10-25 Thread Rick Flosi
Add 'createRelatedTable=False' to your RelatedJoins like: practica=RelatedJoin('practica', createRelatedTable=False) This might only be in 'SQLRelatedJoin' so you might have to use that over 'RelatedJoin'. 'SQLRelatedJoin' has some other advantages so you probably want to use that anyways.

Re: [SQLObject] RelatedJoin efficiency

2006-04-20 Thread Luke Opperman
You could use a SQLRelatedJoin, and then do: coll.members.count() - Luke Quoting Oleg Broytmann <[EMAIL PROTECTED]>: On Thu, Apr 20, 2006 at 03:54:18PM +0300, Max Ischenko wrote: Is there a way to use a COUNT(*) query in context like these? There is no currently. Oleg. -- Oleg Bro

Re: [SQLObject] RelatedJoin efficiency

2006-04-20 Thread Oleg Broytmann
On Thu, Apr 20, 2006 at 03:54:18PM +0300, Max Ischenko wrote: > Is there a way to use a COUNT(*) query in context like these? There is no currently. Oleg. -- Oleg Broytmannhttp://phd.pp.ru/[EMAIL PROTECTED] Programmers don't die, they just GOSUB withou