Luke Opperman | 1 Mar 06:48 2004

RE: MultipleJoin does not respect specified keys

I apologize for not double checking that, the parameter is "joinColumn". It's
in the docs for MultipleJoin, been in code since the beginning as I recall.

- Luke

Quoting jwsacksteder <at> ramprecision.com:

> joinColumnName does not seem to exist. Is this only in cvs?
>
> -----Original Message-----
> From: Luke Opperman [mailto:luke <at> metathusalan.com]
> Sent: Sunday, February 29, 2004 3:27 AM
> To: Jeff Sacksteder
> Cc: sqlobject-discuss <at> lists.sourceforge.net
> Subject: Re: [SQLObject] MultipleJoin does not respect specified keys
>
>
>> It is apparently attempting to
>> guess what the primary key is based on the Style, even though I specified
>> the column name by hand. This is just a bit beyond my ability to fix at
> the
>> moment.
>
> Yes, it tries to guess based on style in this case. SQLObjects are still
> fairly
> self-contained, the CustAccount class does not search out the appropriate
> ForeignKey in ShipTo automatically to determine the name.
>
> You will want to change your join to specify the column name:
>
(Continue reading)

jwsacksteder | 1 Mar 14:52 2004

Finding StringCol lengths

To create a basic gui form interface to my objects, I need to be able to get
some sort of hints regarding the name, number and size of fields the object
has. I can get a list of columns with _SO_Columns or _SO_columnDict, but
that does not contain the field lengths I specified in my classes. My
strategy was to create a public method that combined the private methods
above and the length information from wherever I could find it. However, it
seems that the length, if specified, is only used for validation and table
creation. Where can I extract this information?

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
David McNab | 1 Mar 15:05 2004
Picon

StringCol() only saving 64k

Hi,

I'm trying to save a fat wad of data in a StringCol column, but only the 
first 65536 chars are getting saved.

Is this a MySQL restriction, or something in SQLObject?

Either way, is there a way around this?

--

-- 

Kind regards
David

--

leave this line intact so your email gets through my junk mail filter

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Ian Bicking | 1 Mar 18:44 2004

Re: Finding StringCol lengths

jwsacksteder <at> ramprecision.com wrote:
> To create a basic gui form interface to my objects, I need to be able to get
> some sort of hints regarding the name, number and size of fields the object
> has. I can get a list of columns with _SO_Columns or _SO_columnDict, but
> that does not contain the field lengths I specified in my classes. My
> strategy was to create a public method that combined the private methods
> above and the length information from wherever I could find it. However, it
> seems that the length, if specified, is only used for validation and table
> creation. Where can I extract this information?

I believe you can get it through _SO_columnDict[colName].length, though 
only for StringCols, of course.  If you look in Col.SOString you'll see 
it being assigned.

   Ian

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Chris Gahan | 2 Mar 03:40 2004

Re: StringCol() only saving 64k


"David McNab" <david <at> rebirthing.co.nz> wrote in message
news:40434322.6000901 <at> rebirthing.co.nz...
> I'm trying to save a fat wad of data in a StringCol column, but only the
> first 65536 chars are getting saved.
>
> Is this a MySQL restriction, or something in SQLObject?
>
> Either way, is there a way around this?

I think the best thing to do is NOT use the database to store chunks of data
that big. It can be pretty inefficient with a large table. Writing to the
file system is best.

This doesn't mean you have to stop using SQLObject though! :) SQLObject lets
you add your own functions that get called when a user tries to access an
SQLObject attribute (or any python object, for that matter...).

I think that's probably the best way to do it. Of course, I don't know what
you're trying to do... so take it with a grain of salt.

Here's how you use magic attributes:

http://sqlobject.org/docs/SQLObject.html#adding-magic-attributes-properties

Enjoy!

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
(Continue reading)

Ian Bicking | 2 Mar 07:42 2004

Re: StringCol() only saving 64k

On Mar 1, 2004, at 8:05 AM, David McNab wrote:
> I'm trying to save a fat wad of data in a StringCol column, but only 
> the first 65536 chars are getting saved.
>
> Is this a MySQL restriction, or something in SQLObject?

That's a MySQL restriction (I'd guess -- certainly not SQLObject).  You 
might have better luck with a BLOB column (as opposed to TEXT).

--
Ian Bicking | ianb <at> colorstudy.com | http://blog.ianbicking.org

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Oleg Broytmann | 2 Mar 10:42 2004
X-Face
Picon

Re: StringCol() only saving 64k

On Tue, Mar 02, 2004 at 12:42:54AM -0600, Ian Bicking wrote:
> On Mar 1, 2004, at 8:05 AM, David McNab wrote:
> >I'm trying to save a fat wad of data in a StringCol column, but only 
> >the first 65536 chars are getting saved.
> >
> >Is this a MySQL restriction, or something in SQLObject?
> 
> That's a MySQL restriction (I'd guess -- certainly not SQLObject).  You 
> might have better luck with a BLOB column (as opposed to TEXT).

   Not neccessary. Just use MEDUIMTEXT, or LONGTEXT. Or MEDIUMBLOB or
LOBGBLOB.
   But always look into docs. That 65535 bytes is described there.

Oleg.
--

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

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Scott Russell | 2 Mar 20:18 2004

select() causes SQLObject + webware application to die

I've found a situation in which SQLobject makes webware fall over like a
straw house...

First, a very simple webware servlet:

### Start 1 ##
from WebKit.Page import Page
from SQLObject import *

__connection__ = MySQLConnection(host="host", 
                                 user="user", 
                                 passwd="passwd", 
                                 db="db")

class Person(SQLObject):
    email = StringCol(length=40, default=None)
    firstname = StringCol(length=30, default=None)
    lastname = StringCol(length=30, default=None)

class TestPage(Page):
    def writeContent(self):
        p = Person(1)        
        self.writeln('''Welcome.''')
### End 1 ##

I hammer and hammer and hammer, and it holds up fine - as hard as I can
hit it, it keeps up with me.

Now, a Second Servlet: (Only Changing the TestPage class - everything
else is the same.)
(Continue reading)

martin.clausen | 2 Mar 22:59 2004
Picon

Form fields and SQLObject

I am new to Python and SQLObject and I am looking for tips on how to do a search in a web application that uses SQLObject.

For testing/learning purposes I am using the Person class from the SQlObject:
	
from SQLObject import *

class Person(SQLObject):
	_connection = MySQLConnection(host='localhost', db='test', user='*', passwd='*', debug=1)
	
	firstName = StringCol(length=100)
	middleInitial = StringCol(length=1, default=None)
	lastName = StringCol(length=100)

So far I have a findPerson method that looks like this:

def findPerson(self, id, fn, mi, ln):
	persons = Person.select(
						AND(Person.q.firstName.startswith(fn),
							Person.q.middleInitial.startswith(mi),
							Person.q.lastName.startswith(ln)))
	return persons

Where id, fn, mi and ln are the values of the fields in my search form - not very impressive and problematic in
many ways I know !

What I would like is to implement a findPerson method that, based on the field values incl. any operators - *,
<, >, <=, >= and so on, is able to perform a proper search and return all matching Person objects(rows). I
have fiddled around with some inelegant string substitution to ugly to post. Especially properties - in
this case middleInitial - that defaults to None, are troublesome, since an empty field is not matched by None.

(Continue reading)

Scott Russell | 2 Mar 23:17 2004

Re: select() causes SQLObject + webware application to die

Replying to myself here... Replacing the MySQL connection with a
postgres one doesn't fix anything - although it seems to last about
twice as long, maybe 6 seconds under constant hammering.

How would I even start debugging this?

On Tue, 2004-03-02 at 14:18, Scott Russell wrote:
> I've found a situation in which SQLobject makes webware fall over like a
> straw house...
> 
> First, a very simple webware servlet:
> 
> ### Start 1 ##
> from WebKit.Page import Page
> from SQLObject import *
> 
> __connection__ = MySQLConnection(host="host", 
>                                  user="user", 
>                                  passwd="passwd", 
>                                  db="db")
> 
> class Person(SQLObject):
>     email = StringCol(length=40, default=None)
>     firstname = StringCol(length=30, default=None)
>     lastname = StringCol(length=30, default=None)
> 
> class TestPage(Page):
>     def writeContent(self):
>         p = Person(1)        
>         self.writeln('''Welcome.''')
(Continue reading)


Gmane