<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://permalink.gmane.org/gmane.comp.python.sqlobject">
    <title>gmane.comp.python.sqlobject</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9381"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9380"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9379"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9378"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9377"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9376"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9375"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9374"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9373"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9372"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9371"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9370"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9369"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9368"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9367"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9366"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9365"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9364"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9363"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.sqlobject/9362"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9381">
    <title>Re: How to use OVERLAPS keyword with SQLObject?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9381</link>
    <description>
   There is no.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-24T19:20:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9380">
    <title>How to use OVERLAPS keyword with SQLObject?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9380</link>
    <description>I just learned about the OVERLAPS keyword, used like this:

matt=# select (TIMESTAMP '2008-07-24 03:00:00', TIMESTAMP '2008-07-24
09:00:00') overlaps (TIMESTAMP '2008-07-24 5:0:0', TIMESTAMP '2008-07-24
11:0:0')
;
 overlaps 
----------
 t
(1 row)


I'm testing if the time interval from 3 AM today through 9 AM today
overlaps the time interval from 5 AM through 11 AM.

How can I use this with SQLObject?

I poked around a little with SQLOp.  Before I write an ugly patch, is
there already a way to do it?

It is important to use the TIMESTAMP label to disambiguate types.

Matt


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Matthew Wilson</dc:creator>
    <dc:date>2008-07-24T18:25:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9379">
    <title>Re: sqlobject 0.10 and picklecol protocol problem</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9379</link>
    <description>
   It does. I clearly remember we discussed this a year or two ago but
you lost interest because you stopped using PickleCol.


   Oh, MySQLdb... no, not again, please! :( Still there is no way to force
MySQLdb into ascii-only? Does setting 'charset=...' in the DB URI help?

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-24T15:29:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9378">
    <title>sqlobject 0.10 and picklecol protocol problem</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9378</link>
    <description>Hi

there seem to be a problem with picklecol and v0.10
It seem that v0.10 uses highest pickle protocol by default (2).
When reading back there are problems related to protocol2 and unicode. 
pickle does not understand what it just pickled before...

Can someone confirm this?
My workaround is to force protocol 0.

Thanks for all



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Sophana</dc:creator>
    <dc:date>2008-07-24T15:17:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9377">
    <title>Re: Nested Table/Foreign Key to same table</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9377</link>
    <description>
   Welcome! Don't be too afraid. (-:

[skip]


   MultipleJoin expects an "*_id" column in the other table (even if the
other table is the same table itself). ForeignKey provides such key but you
have to tip MultipleJoin what column to use. This works for me:

class NestedTest(SQLObject):
   attr1 = StringCol()
   attr2 = StringCol()
   parent = ForeignKey('NestedTest', default=None)
   children = MultipleJoin('NestedTest', joinColumn='parent_id')

NestedTest.createTable()

n1=NestedTest(attr1='first', attr2='55408')
n2=NestedTest(attr1='second', attr2='55409', parent=n1)
n3=NestedTest(attr1='third', attr2='55410', parent=n1)

print n1.children

   The output is:

[&lt;NestedTest 2 attr1='second' attr2='55409' parentID=1&gt;, &lt;NestedTest 3 attr1='third' attr2='55410' parentID=1&gt;]

   Seems ok for me.

PS. Proper plural for for the word 'child' is 'children' :-)

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-24T15:15:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9376">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9376</link>
    <description>
   Depends on the applications and the DB. If you know the row is in the DB
already just point to it using "...FOREIGN KEY REFERENCES...." (I mean SQL
CREATE TABLE). If you aren't sure the row is there, I doubt there is
a magical service in an SQL backend. You just have to check regularly if
the row has been inserted. SQLObject can help a bit - Luke Opperman
reminded how you can pass a callable as a default value - but that's all.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-24T15:03:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9375">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9375</link>
    <description>
So, if I wanted to make sure that some rows are always in the Sales
table, is there a recommended approach?

Matt


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Matthew Wilson</dc:creator>
    <dc:date>2008-07-24T13:49:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9374">
    <title>Nested Table/Foreign Key to same table</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9374</link>
    <description>-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
</description>
    <dc:creator>dimi duj</dc:creator>
    <dc:date>2008-07-24T07:56:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9373">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9373</link>
    <description>As Oleg notes, your default argument call to byName is evaluated at class
creation time ie, before you've created the Sales Department record. In the same
way, if you had:

  when = DateTimeCol(default=now())

the default would always be the value returned by now() at the time the class is
imported.

However, default can also be a callable. In the datetime example, changing it to:
  when = DateTimeCol(default=now)

will cause SQLObject to call now() separately for each insert (that needs the
default for this column).

So as long as the Sales department is created before you actually insert any
Employees, something like this should work to make that byName call lazy:

def get_sales_dept():
  return Department.byName('SALES')

class Employee(SQLObject):
  user_name = UnicodeCol(alternateID=True)
  department = ForeignKey(default=get_sales_dept)

- Luke



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build </description>
    <dc:creator>Luke Opperman</dc:creator>
    <dc:date>2008-07-23T23:59:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9372">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9372</link>
    <description>
   I don't see how you can misinterpret this. There is no 'Sales'
department in the DB, so why do you expect SQLObject magically finds one?!
   .byName() is an "active" operation, it cannot be done lazily. You have
to know in advance the id of the 'Sales' department.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-23T21:26:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9371">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9371</link>
    <description>
It fails in the instance where I'm importing a model with an empty
database. So for example, my unit tests use a sqlite :memory: database,
and this won't work.

The byName lookup raises an SQLObjectNotFound exception.

Sorry, I should have been more clear.

Matt


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Matthew Wilson</dc:creator>
    <dc:date>2008-07-23T21:04:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9370">
    <title>Re: How to provide default non-null values for foreignkeys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9370</link>
    <description>
   In what way? For .byName() to work Department.name must be an
alternateID column (which implies uniqueness).
   This works for me:

class Department(SQLObject):
   name = StringCol(default=None, alternateID=True)

Department.createTable()

Department(name='Directorat')
Department(name='Sales')

class Employee(SQLObject):
   name = StringCol(default=None)
   department = ForeignKey('Department', default=Department.byName('Sales'))

Employee.createTable()
Employee(name='slave')

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-23T20:01:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9369">
    <title>How to provide default non-null values for foreign keys?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9369</link>
    <description>I have an employees table and a departments table, and every employee
has a foreign key to the departments table.

99% of the time, new employees belong to one particular department,
"SALES".

How can I make the SALES department the default department for new
employees?

I tried this:

    class Department(SQLObject):
        name = UnicodeCol(alternateID=True)

    class Employee(SQLObject):
        user_name = UnicodeCol(alternateID=True)
        department = ForeignKey(default=Department.byName("SALES")

And it failed.

Any ideas?

Thanks in advance.

Matt


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Matthew Wilson</dc:creator>
    <dc:date>2008-07-23T19:50:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9368">
    <title>Re: assert id is not None</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9368</link>
    <description>
Thanks for the explanation.  I've filed a bug and am following your
suggestion of declaring my columns explicitly.  All is well for now. :)

Ray

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Ray Van Dolson</dc:creator>
    <dc:date>2008-07-22T23:42:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9367">
    <title>Re: childName</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9367</link>
    <description>
class Test1(InheritableSQLObject):
   name1 = StringCol(default=None)

class Test2(Test1):
   name2 = StringCol(default=None)

Test1.createTable()
Test2.createTable()

t1 = Test1(name1='test1')
t2 = Test2(name2='test2')

print t2._parent.childName # prints 'Test2'

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-22T19:01:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9366">
    <title>childName</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9366</link>
    <description>-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss&lt; at &gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
</description>
    <dc:creator>Luis Javier Peris</dc:creator>
    <dc:date>2008-07-22T18:48:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9365">
    <title>Re: SQLObject with a custom backend?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9365</link>
    <description>
   I am afraid you have to patch mysqlconnection backend pretty
extensively. Start looking at sqlobject/dbconnection.py, then
sqlobject/mysql/mysqlconnection.py.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-22T13:16:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9364">
    <title>SQLObject with a custom backend?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9364</link>
    <description>What if I want to modify the backend to SQLObject in some way?
I want its requests to call my own custom function(s) that ultimately
use the DBS.

Basically I'm using stackless and I want my custom function to put the
request in a queue that goes to a thread pool of database connections
to MySQL and when a result is ready sends it back to the function on a
channel so that the function can return the result.

Can this be done?

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>inhahe</dc:creator>
    <dc:date>2008-07-22T11:25:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9363">
    <title>Re: assert id is not None</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9363</link>
    <description>
   And there is SystemsInfo.sqlmeta.delColumn() call.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-22T10:34:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9362">
    <title>Re: assert id is not None</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9362</link>
    <description>[skip]

   If idTYpe is not autoincrement (integer, actually) SQLObject expects
'id' in the list of passed columns:

[skip]


   Oops, seems like a bug. I think what caused the bug is using
fromDatabase and idName simultaneously - SQLObject drew SystemName from the
DB and added it because of the idName. To work around the bug avoid
using fromDatabase - declare your columns explicitly.


   SQLObject stores columns in dictionaries so the order (of keys) could be
random. Do not rely on the order of columns in SO.


   Columns are in SystemsInfo.sqlmeta object (see main.py), in .columns,
.columnList, .columnDefinitions.

Oleg.
</description>
    <dc:creator>Oleg Broytmann</dc:creator>
    <dc:date>2008-07-22T10:06:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.sqlobject/9361">
    <title>Re: assert id is not None</title>
    <link>http://permalink.gmane.org/gmane.comp.python.sqlobject/9361</link>
    <description>
Hmm, I am guessing the note right above this:

  http://www.sqlobject.org/SQLObject.html#class-sqlmeta

Is probably a big part of my issue. :)  Since my primary key in this
case is _not_ immutable.

Am I on the right track?  Any way to override this behavior (other than
the try/except or python -O)?

Ray

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/
</description>
    <dc:creator>Ray Van Dolson</dc:creator>
    <dc:date>2008-07-22T00:34:39</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.comp.python.sqlobject">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.python.sqlobject</link>
  </textinput>
</rdf:RDF>
