Daniel Fetchinson | 1 Nov 23:04

Re: Short vacation

> Hi! I'm leaving the Net for a week. Will be back at 6th of November.

Have fun on your vacation Oleg!

Cheers,
Daniel

--

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
Wolfgang Morawetz | 8 Nov 21:45
Picon
Picon

Select does not work with some fieldname

Hi,
please help.
how do i this SQL
SELECT *
FROM `TAthlet`
WHERE TCountry_id = 'AUT'

The table "TAthlet" have this fields:
TUnion_id
id
short
name
TGender_id
TGoup_id
TCountry_id

This does not work:
from sqlobject import *
sqlhub.processConnection =
connectionForURI('mysql://archer:xxxxxx <at> localhost/adb')

class TAthlet(SQLObject):
    class sqlmeta:
        #if i dont do this i get a wrong tathlet table
        table = "TAthlet"
        fromDatabase = True

TAthlet._connection.debug = True
r = TAthlet.select(TAthlet.q.Tcountry_id=='AUT')

(Continue reading)

Petr Jakeš | 8 Nov 22:01
Picon

Re: Select does not work with some fieldname


please help.
how do i this SQL
SELECT *
FROM `TAthlet`
WHERE TCountry_id = 'AUT'

The table "TAthlet" have this fields:
TUnion_id
id
short
name
TGender_id
TGoup_id
TCountry_id

This does not work:
from sqlobject import *
sqlhub.processConnection =
connectionForURI('mysql://archer:xxxxxx <at> localhost/adb')

class TAthlet(SQLObject):
   class sqlmeta:
       #if i dont do this i get a wrong tathlet table
       table = "TAthlet"
       fromDatabase = True

TAthlet._connection.debug = True
r = TAthlet.select(TAthlet.q.Tcountry_id=='AUT')

The Error:
AttributeError: TAthlet instance has no attribute 'Tcountry_id'

what about:
r = TAthlet.select(TAthlet.q.TcountryId=='AUT')

Petr

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Petr Jakeš | 10 Nov 13:30
Picon

Re: Select does not work with some fieldname

2009/11/10 Wolfgang Morawetz <wolfgang.morawetz <at> gmx.at>
Petr Jakeš schrieb:
>
>     Maybe you can printout the names SQLObject reads from the database
>     and than use this names:
>     for col in TCountry.sqlmeta.columnList:
>         print col
>
> Or maybe:
>
> print col.origName, col.dbName
>
> Petr
>
Hmmm,
for TAthlet i get:
TUnionID TUnion_id
short short
name name
TGenderID TGender_id
TGroupID TGroup_id
TCountryID TCountry_id

and for TCountry:
name name

So SQLObject removes the underline ok, but i get no id fields?

BTW Thanks for helping Petr!

You can define (name) existing columns (names) explicitly. Even existing ID column. I am using existing database as well and I am connecting to it this way:

class Cenktgm01(SQLObject):
#    _connection = connection
    class sqlmeta:       
        idType = str
        idName = 'OID$CENKTGM01'
    ktgi = StringCol(dbName="ktginterni")

BTW, you do not need to know about the id. SQLObject is treating id automatically beneath the scene.

Sometime wiki can help: http://wiki.sqlobject.org/
I am experimenting with the SQLite inMemory database a lot as well (as shown in following exampe).

from sqlobject import *
connectionInMemory = connectionForURI('sqlite:/:memory:')
class Person(SQLObject):
    _connection = connectionInMemory
    firstName = StringCol()
    middleInitial = StringCol(length=1, default=None)
    lastName = StringCol()

Regards

Petr

PS: please try to "reply to all", so other peeople in the mailing list can help/comment as well.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Oleg Broytman | 19 Nov 15:02
X-Face
Picon
Favicon

SQL pie chart

Absolute crazy SQL, both the idea and the code:
http://code.openark.org/blog/mysql/sql-pie-chart

   Not related to SQLObject or even Python, but it's so crazy I cannot
resist. (-:

Oleg.
--

-- 
     Oleg Broytman            http://phd.pp.ru/            phd <at> phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Daniel Fetchinson | 19 Nov 18:00

Re: SQL pie chart

> Absolute crazy SQL, both the idea and the code:
> http://code.openark.org/blog/mysql/sql-pie-chart
>
>    Not related to SQLObject or even Python, but it's so crazy I cannot
> resist. (-:

Is it portable to all backends sqlobject supports? :)

Cheers,
Daniel

--

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Oleg Broytman | 19 Nov 18:05
X-Face
Picon
Favicon

Re: SQL pie chart

On Thu, Nov 19, 2009 at 06:00:02PM +0100, Daniel Fetchinson wrote:
> > Absolute crazy SQL, both the idea and the code:
> > http://code.openark.org/blog/mysql/sql-pie-chart
> >
> >    Not related to SQLObject or even Python, but it's so crazy I cannot
> > resist. (-:
> 
> Is it portable to all backends sqlobject supports? :)

   If I knew... Actually, I didn't recognize the SQL dialect used.
There is 'mysql' in the URL, but I doubt it is really MySQL.

Oleg.
--

-- 
     Oleg Broytman            http://phd.pp.ru/            phd <at> phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Daniel Fetchinson | 20 Nov 00:25

Re: SQL pie chart

>> > Absolute crazy SQL, both the idea and the code:
>> > http://code.openark.org/blog/mysql/sql-pie-chart
>> >
>> >    Not related to SQLObject or even Python, but it's so crazy I cannot
>> > resist. (-:
>>
>> Is it portable to all backends sqlobject supports? :)
>
>    If I knew... Actually, I didn't recognize the SQL dialect used.
> There is 'mysql' in the URL, but I doubt it is really MySQL.

>From the output it also seems to me that it is mysql, actually I am
pretty certain it is.

Would love to do this in sqlite :)

Cheers,
Daniel

--

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
inf200475 | 27 Nov 04:19
Picon

relation

Hi , first of all sorry for my english, I speak Spanish, but I am working with SQLObject and I am a newbie, and I dont know how to make a relation among 3 tables M:M
Thanks

Untitled Document

Participe en Universidad 2010,
del 8 al 12 de febrero del 2010
La Habana, Cuba
http://www.universidad2010.cu
http://www.universidad2010.com

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Oleg Broytman | 27 Nov 11:28
X-Face
Picon
Favicon

Re: relation

On Thu, Nov 26, 2009 at 10:19:24PM -0500, inf200475 <at> ucf.edu.cu wrote:
> Hi , first of all sorry for my english, I speak Spanish, but I am working with SQLObject
> and I am a newbie,

   Welcome!

> and I dont know how to make a relation among 3 tables M:M

   Probably you need 3 separate relations - table1<->table2,
table2<->table3, table1<->table3.
   What SQL queries do you have in mind? I must say in advance that
high-level API in SQLObject doesn't allow any query to be expressed in
SQLObject's objects, but there is medium-level API that allows you to
execute any SQL query and get back the list of lists of results.

Oleg.
--

-- 
     Oleg Broytman            http://phd.pp.ru/            phd <at> phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

Gmane