Hi!

On Wed, Jan 19, 2011 at 06:18:21PM +0100, fortuna123 Gazeta.pl wrote:
> class Person(SQLObject):
> ...     fname = StringCol()
> ...     mi = StringCol(length=1, default=None)
> ...     lname = StringCol()
> ...
> >>> Person.createTable()
> 
> This create table in base who don't have name but i have base who i create
> write this

   I don't think the table is in a DB without a name. All DB operations
require a connection to a DB; either you have a connection or SQLObject
complains.

> createdb fortuna_bib and i don't know how i create class in this base.

   Create a connection to that database. There are a few ways to do it
in SQLObject:

sqlobject.sqlhub.processConnection = connectionForURI('postgres:/fortuna_bib')

   sqlhub is the global connection that's shared between all SQLObject
tables.
   Or do

Person.setConnection('postgres:/fortuna_bib')

   This sets connection only for the table.

   And now, when you have the connection to the specific database - call

Person.createTable()

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            p...@phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to