[SQLObject] PATCH: using foreign keys in select

2006-01-19 Thread Pau Aliagas
Well, as I thought that this issue was important for making queries much natutral, I've cooked a patch to implement it. It was really really easy, short and clean, but I think it's a GREAT addition to the code. I've added it to the SF tracker (id = 1410527): http://sourceforge.net/tracker/ind

[SQLObject] Database connections and program startup.

2006-01-19 Thread Jonathan Daugherty
Greetings, I'm using SQLObject 0.6 and Python 2.3. I'm new to SQLObject, and it's very enjoyable. I'm trying to decide how best to set my connection object so all of my SQLObject classes can have access to it. It appears that I have three options: - Use a _connection attribute in the class de

[SQLObject] Re: Did you call?

2006-01-19 Thread Randall Smith
Sorry guys. Ignore this thread. Randall --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the we

[SQLObject] Did you call?

2006-01-19 Thread Randall Smith
Karen, Did you try to call me around noon? Randall --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surf

Re: [SQLObject] using foreign keys in select has and incongruent behaviour

2006-01-19 Thread Pau Aliagas
On Thu, 19 Jan 2006, Justin Azoff wrote: Pau Aliagas wrote: I have two tables: class handset_brand(SQLObject): brand = StringCol(alternateID = True, length = 50) handsets = SQLMultipleJoin('handset') class handset(SQLObject): handset_brand = ForeignKey('handset_brand'

Re: [SQLObject] using foreign keys in select has and incongruent behaviour

2006-01-19 Thread Justin Azoff
Pau Aliagas wrote: I have two tables: class handset_brand(SQLObject): brand = StringCol(alternateID = True, length = 50) handsets = SQLMultipleJoin('handset') class handset(SQLObject): handset_brand = ForeignKey('handset_brand') model = StringCol(alternateID = T

Re: [SQLObject] using foreign keys in select has and incongruent behaviour

2006-01-19 Thread Pau Aliagas
On Thu, 19 Jan 2006, Pau Aliagas wrote: Sorry for folowing up myself, there are some mistakes, the question still remains. I should have used the dotq syntax in select! I have two tables: class handset_brand(SQLObject): brand = StringCol(alternateID = True, length = 50) handse

[SQLObject] using foreign keys in select has and incongruent behaviour

2006-01-19 Thread Pau Aliagas
I have two tables: class handset_brand(SQLObject): brand = StringCol(alternateID = True, length = 50) handsets = SQLMultipleJoin('handset') class handset(SQLObject): handset_brand = ForeignKey('handset_brand') model = StringCol(alternateID = True, length = 25)

[SQLObject] destroySelf() and RelatedJoins

2006-01-19 Thread Max Ischenko
Hello, I'm using RelatedJoin to specify many to many relationships and discover that SQLobject doesn't clean up intermediate table when the object is destroyed. E.g.: class User(SQLObject): class sqlmeta: table = "users" # default 'user' might cause SQL errors groups = RelatedJo

[SQLObject] sortby count

2006-01-19 Thread Andreas Zwinkau
Hi there, i'm creating an event database, where i have events and users with a many-to-many relationship (think visitors). Now i want to get the most popular Events i.e. those with the most visitors. Intuitive would be: Event.select(orderBy="visitors") # where visitors = RelatedJoin("User", addR

RE: [SQLObject] unicode string in queries - a bug?

2006-01-19 Thread Max Ischenko
Hello, > > It seems that SQLObject doesn't allow unicode string when running SQL > > statements, > specifically to specify values for UnicodeCol keys. OTOH, when creating an > object, unicode > strings is accepted and converted properly into needed encoding, like utf-8. > > > > Is it a bug or I'

[SQLObject] recursive error

2006-01-19 Thread Peter Damoc
Hello list, I've got this: File "c:\Projects\pataccess\trunk\models.py", line 20, in ? class Dates(SQLObject): File "c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\declarative.py", line 94, in __new__ cls.__classinit__(cls, new_attrs) File "c:\python24\lib\

Re: [SQLObject] unicode string in queries - a bug?

2006-01-19 Thread Oleg Broytmann
On Thu, Jan 19, 2006 at 12:40:46PM +0200, Max Ischenko wrote: > Hello, > > It seems that SQLObject doesn't allow unicode string when running SQL > statements, specifically to specify values for UnicodeCol keys. OTOH, when > creating an object, unicode strings is accepted and converted properly i

Re: [SQLObject] I need som help understanding SQLObject usage

2006-01-19 Thread Oleg Broytmann
On Thu, Jan 19, 2006 at 10:50:43AM +0200, Peter Damoc wrote: > first the datetime issue: > > I naively tried to use a DateTimeCol for a birthday but I keep getting > OverflowError: mktime argument out of range This is a known bug. It is fixed in 0.7-branch and will be in 0.7.1 when it will be

Re: [SQLObject] case insensitive sort with sqlite, sorting one-to-many relationships

2006-01-19 Thread Oleg Broytmann
On Wed, Jan 18, 2006 at 06:19:13PM -0800, Stephen Hassard wrote: > One of my queries is sorting output from a database. The sort is working > properly, but is returning lower case results after the upper case ones, > ie: A, B, C, a, b, c. Is their any way to tell SQLObject to tell sqlite > to so

[SQLObject] unicode string in queries - a bug?

2006-01-19 Thread Max Ischenko
Hello, It seems that SQLObject doesn't allow unicode string when running SQL statements, specifically to specify values for UnicodeCol keys. OTOH, when creating an object, unicode strings is accepted and converted properly into needed encoding, like utf-8. Is it a bug or I'm doing something wr

[SQLObject] I need som help understanding SQLObject usage

2006-01-19 Thread Peter Damoc
Hello list, I've begun investigating SQLObject for one of my projects but I've encountered several problems. first the datetime issue: I naively tried to use a DateTimeCol for a birthday but I keep getting OverflowError: mktime argument out of range How should I describe a birthday? Should I