<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to support-requests</title><link>https://sourceforge.net/p/sqlobject/support-requests/</link><description>Recent changes to support-requests</description><atom:link href="https://sourceforge.net/p/sqlobject/support-requests/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 14 Jul 2011 07:40:43 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/sqlobject/support-requests/feed.rss" rel="self" type="application/rss+xml"/><item><title>The speed of SQLObject is slower on the time</title><link>https://sourceforge.net/p/sqlobject/support-requests/6/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I had a test of a SQLObject and I had found a strange behaviour of SQLObject. On the time, the respond time is lesser.&lt;/p&gt;
&lt;p&gt;Here, I put a example of test code :&lt;/p&gt;
&lt;p&gt;from sqlobject.sqlbuilder import *&lt;br /&gt;
connection = connectionForURI('postgresql://test:test@localhost/test_sql_object')&lt;br /&gt;
sqlhub.processConnection = connection&lt;/p&gt;
&lt;p&gt;class Person(SQLObject):&lt;br /&gt;
firstName = StringCol()&lt;br /&gt;
middleInitial = StringCol(length=1, default=None)&lt;br /&gt;
lastName = StringCol()&lt;/p&gt;
&lt;p&gt;iteration = 0&lt;br /&gt;
while 1:&lt;br /&gt;
start = datetime.now()&lt;br /&gt;
person_list = []&lt;br /&gt;
for key in range(1000):&lt;br /&gt;
person = Person.selectBy(firstName='name%s%s' % (iteration,key))[0]&lt;br /&gt;
person_list.append(person)&lt;/p&gt;
&lt;p&gt;for person in person_list:&lt;br /&gt;
person.expire()&lt;br /&gt;
del person&lt;br /&gt;
del person_list&lt;br /&gt;
sqlhub.processConnection.cache.clear()&lt;/p&gt;
&lt;p&gt;end = datetime.now()&lt;/p&gt;
&lt;p&gt;print "TIME ",iteration,':' , end - start&lt;br /&gt;
iteration = iteration + 1&lt;/p&gt;
&lt;p&gt;In the result I can check that in each iteration the time is bigger. The first iteration has time of 1.37s, then the time increases and the 19 iteration has time of 5.83 s!&lt;/p&gt;
&lt;p&gt;TIME  0 : 0:00:01.376392&lt;br /&gt;
TIME  1 : 0:00:01.663250&lt;br /&gt;
TIME  2 : 0:00:01.978639&lt;br /&gt;
TIME  3 : 0:00:02.319939&lt;br /&gt;
TIME  4 : 0:00:02.618213&lt;br /&gt;
TIME  5 : 0:00:02.723846&lt;br /&gt;
TIME  6 : 0:00:02.584007&lt;br /&gt;
TIME  7 : 0:00:02.868877&lt;br /&gt;
TIME  8 : 0:00:03.051937&lt;br /&gt;
TIME  9 : 0:00:03.389757&lt;br /&gt;
TIME  10 : 0:00:03.503036&lt;br /&gt;
TIME  11 : 0:00:03.563154&lt;br /&gt;
TIME  12 : 0:00:04.191539&lt;br /&gt;
TIME  13 : 0:00:04.274464&lt;br /&gt;
TIME  14 : 0:00:04.813206&lt;br /&gt;
TIME  15 : 0:00:04.677002&lt;br /&gt;
TIME  16 : 0:00:04.995708&lt;br /&gt;
TIME  17 : 0:00:05.126811&lt;br /&gt;
TIME  18 : 0:00:05.571279&lt;br /&gt;
TIME  19 : 0:00:05.832840&lt;/p&gt;
&lt;p&gt;Why is happend this? &lt;br /&gt;
Thanks in advance for your attention.&lt;br /&gt;
Cheers Rosa&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rosa Robles</dc:creator><pubDate>Thu, 14 Jul 2011 07:40:43 -0000</pubDate><guid>https://sourceforge.netb0882778ead9e9d98f1381693c069660bfa7ca8f</guid></item><item><title>SQLObject documentation</title><link>https://sourceforge.net/p/sqlobject/support-requests/5/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;SQLObject is a brilliant project and it's much fun &lt;br /&gt;
working with it..... Once you figured out the details. &lt;br /&gt;
SQLObject suffers from a *horrid* documentation.&lt;/p&gt;
&lt;p&gt;Starting a project from scratch is explained well &lt;br /&gt;
enough. But if you have to re-use an existing &lt;br /&gt;
database. It's inevitable that you need to use more &lt;br /&gt;
advanced features of SQLObject. And those are only &lt;br /&gt;
badly (if at all) documented. For example:&lt;/p&gt;
&lt;p&gt;You can use a different "Style" object to indicate&lt;br /&gt;
a different naming convention.&lt;/p&gt;
&lt;p&gt;But which "Style" objects exist? What are the &lt;br /&gt;
parameters? Is it possible to create a Style object &lt;br /&gt;
yourself? If so, how? What methods need to be &lt;br /&gt;
overridden and what do they need to do?&lt;/p&gt;
&lt;p&gt;You might say: "Hey, it's open-source. Browse the &lt;br /&gt;
source code and see for yourself." And that's fine by &lt;br /&gt;
me. But then, *please* document the code! My first try &lt;br /&gt;
was to open up the python interpreter and do a &lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; help(SQLObject)&lt;br /&gt;
and go from there. Nothing useful showed up.&lt;/p&gt;
&lt;p&gt;Honestly, for me time is money, and I was really close &lt;br /&gt;
to giving up with SQLObject for this reason. However I &lt;br /&gt;
like SQLObject. So I'll take a sip of vinegar and &lt;br /&gt;
stick with it. After doing a lot of digging, I got &lt;br /&gt;
most things to work. But not necessarily the way I &lt;br /&gt;
want them to. Alas, it works.&lt;/p&gt;
&lt;p&gt;The gist of this message is: There might be people &lt;br /&gt;
less willing to do some research, and drop SQLObject &lt;br /&gt;
quickly. It would be sad, if SQLObject suffers from &lt;br /&gt;
it's lack of documentation. And if I understood more &lt;br /&gt;
of it's inner-workings, I would offer you to write &lt;br /&gt;
some documentation, and even redesign the web-page, as &lt;br /&gt;
-- quite frankly -- it has a bit of a chaotic look. &lt;br /&gt;
The way I understand it, it's automatically generated, &lt;br /&gt;
so it's not your fault.&lt;/p&gt;
&lt;p&gt;Anyhow, I hope you read this message as positive &lt;br /&gt;
criticism and not as a rant/flame. As it was not &lt;br /&gt;
intended as such.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michel Albert&lt;/p&gt;
&lt;p&gt;p.s.: is it possible to do a naming style that works &lt;br /&gt;
like mixed-case, but keeps the first letter small? Or &lt;br /&gt;
even better, one that completely keeps the style of &lt;br /&gt;
the variable (does no modifications whatsoever)? &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michel Albert</dc:creator><pubDate>Wed, 16 Aug 2006 07:55:56 -0000</pubDate><guid>https://sourceforge.net6ce9169c991d8dd9130572b50e589a568d6d404b</guid></item><item><title>SQLite table name mismatch</title><link>https://sourceforge.net/p/sqlobject/support-requests/4/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am fairly new to python and SQLObject.  I have been&lt;br /&gt;
asked to resurrect some code and have been having a&lt;br /&gt;
reoccurring problem:  as near as I can tell, the column&lt;br /&gt;
name to object name translation intermittently&lt;br /&gt;
mismatches (omits/adds a _ in middle of name before a&lt;br /&gt;
capital.)&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;EG&lt;br /&gt;
For relationItem in table.relationThing:&lt;br /&gt;
    Print relationItem&lt;br /&gt;
Will consistently generate a database error no such&lt;br /&gt;
column: relation_thing_id .  The column is named&lt;br /&gt;
relationthing_id.  The tables are generated form the&lt;br /&gt;
classes, and have a consistent naming schema for&lt;br /&gt;
foreign keys.  All other times this relation is&lt;br /&gt;
referenced, it generates the right table name.&lt;/p&gt;
&lt;p&gt;I have spent a few weeks trying combinations of&lt;br /&gt;
different versions of python (2.3 and 2.4), pysqlite&lt;br /&gt;
(2.0.4, 1.1.6, 1.0), sqlite (2.8, 3.2.5) and OS (winXP,&lt;br /&gt;
SuSE, Debian) and have not had any success elevating&lt;br /&gt;
this problem.  The code ran at one point, but the box&lt;br /&gt;
that it was running on has since been formatted.  I&lt;br /&gt;
have also tried the SQLObject version 7 with same&lt;br /&gt;
results.  These configurations pass the regression testing.&lt;/p&gt;
&lt;p&gt;This looks to be an amazing tool, and I would like to&lt;br /&gt;
include it in future projects, provided that I can get&lt;br /&gt;
it working. &lt;/p&gt;
&lt;p&gt;Any help would be welcome,&lt;br /&gt;
matt inthefrist@hotmail.com&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 29 Sep 2005 19:37:11 -0000</pubDate><guid>https://sourceforge.net3aba339e4b8eac4d0325091216fbcf8c53caa404</guid></item><item><title>ForeignKey Column Name Limitation</title><link>https://sourceforge.net/p/sqlobject/support-requests/3/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;This is probably a feature not a bug. It might be how&lt;br /&gt;
SQLObject does some of its magic. If I do the following:&lt;/p&gt;
&lt;p&gt;class Person (SQLObject) :&lt;br /&gt;
dbName = StringCol()&lt;br /&gt;
dbAddresses = MultipleJoin('Address')&lt;/p&gt;
&lt;p&gt;class Address (SQLObject) :&lt;br /&gt;
dbStreet = StringCol()&lt;br /&gt;
person = ForeignKey('Person')&lt;/p&gt;
&lt;p&gt;# Assume tables are created.&lt;/p&gt;
&lt;p&gt;p = Person(dbName='me')&lt;br /&gt;
print p.dbAddresses&lt;/p&gt;
&lt;p&gt;a = Address(dbStreet='street',person=p)&lt;br /&gt;
print p.dbAddresses&lt;br /&gt;
print a.person&lt;/p&gt;
&lt;p&gt;This works as expected. However, if I change 'person'&lt;br /&gt;
in the Address class to 'dbPerson' I get a traceback&lt;br /&gt;
ending with: DatabaseError: no such column: person_id.&lt;br /&gt;
This traceback occurs at line p = Person(dbName='me').&lt;/p&gt;
&lt;p&gt;It appears that the column name in Addresses,&lt;br /&gt;
ForeignKey'ed to Person must match the class name. In&lt;br /&gt;
addition, you cannot overwrite the column name using&lt;br /&gt;
dbPerson = ForeignKey('Person', dbName='person').&lt;/p&gt;
&lt;p&gt;Am I correct that the column name must match the&lt;br /&gt;
reference class to use ForeignKey?&lt;/p&gt;
&lt;p&gt;cheers, Alex.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aledain</dc:creator><pubDate>Thu, 22 Sep 2005 04:03:51 -0000</pubDate><guid>https://sourceforge.netbd35bb75c21ed5e945a9e037d71d8bf1970896e4</guid></item><item><title>total newbie using CherryPy &amp; SQLObject</title><link>https://sourceforge.net/p/sqlobject/support-requests/2/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The following code sample seems to only update via&lt;br /&gt;
cache, and I don't see the actual record updated nor&lt;br /&gt;
inserted in the database when I call 'store'.  I turned&lt;br /&gt;
on debugging and I can see the SQL statements.  I can&lt;br /&gt;
attach to MySQL and query it directly via localhost. &lt;br /&gt;
select works fine, too.  I can see a row I manually&lt;br /&gt;
enter via the web form.&lt;/p&gt;
&lt;p&gt;Any assistance is appreciated!&lt;/p&gt;
&lt;p&gt;----------------&lt;/p&gt;
&lt;p&gt;from cherrypy import cpg&lt;br /&gt;
from Cheetah.Template import Template&lt;br /&gt;
from sqlobject.mysql.mysqlconnection import MySQLConnection&lt;/p&gt;
&lt;p&gt;conn = MySQLConnection(user='root', db='test',&lt;br /&gt;
passwd="", debug=1)&lt;/p&gt;
&lt;p&gt;# this is our (only) data class.&lt;br /&gt;
class Contact(SQLObject):&lt;br /&gt;
_connection = conn&lt;br /&gt;
lastName = StringCol(length = 50, notNone = True)&lt;br /&gt;
firstName = StringCol(length = 50, notNone = True)&lt;br /&gt;
phone = StringCol(length = 30, notNone = True,&lt;br /&gt;
default = '')&lt;br /&gt;
email = StringCol(length = 30, notNone = True,&lt;br /&gt;
default = '')&lt;br /&gt;
url = StringCol(length = 100, notNone = True,&lt;br /&gt;
default = '')&lt;/p&gt;
&lt;p&gt;class ContactManager:&lt;br /&gt;
def index(self):&lt;br /&gt;
# Let's display a list of all stored contacts.&lt;br /&gt;
contacts = Contact.select()&lt;/p&gt;
&lt;p&gt;template = Template('''&lt;br /&gt;
&amp;lt;h2&amp;gt;All Contacts&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;#for $contact in $contacts&lt;br /&gt;
&amp;lt;a&lt;br /&gt;
href="mailto:$contact.email"&amp;gt;$contact.lastName,&lt;br /&gt;
$contact.firstName&amp;lt;/a&amp;gt;&lt;br /&gt;
[&amp;lt;a href="./edit?id=$contact.id"&amp;gt;Edit&amp;lt;/a&amp;gt;]&lt;br /&gt;
[&amp;lt;a&lt;br /&gt;
href="./delete?id=$contact.id"&amp;gt;Delete&amp;lt;/a&amp;gt;]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
#end for&lt;/p&gt;
&lt;p&gt;&amp;lt;p&amp;gt;[&amp;lt;a href="./edit"&amp;gt;Add new contact&amp;lt;/a&amp;gt;]&amp;lt;/p&amp;gt;&lt;br /&gt;
''', [locals(), globals()])&lt;/p&gt;
&lt;p&gt;return template.respond()&lt;/p&gt;
&lt;p&gt;index.exposed = True&lt;/p&gt;
&lt;p&gt;def edit(self, id = 0):&lt;br /&gt;
# we really want id as an integer. Since&lt;br /&gt;
GET/POST parameters&lt;br /&gt;
# are always passed as strings, let's convert it.&lt;br /&gt;
id = int(id)&lt;/p&gt;
&lt;p&gt;if id &amp;gt; 0:&lt;br /&gt;
# if an id is specified, we're editing an&lt;br /&gt;
existing contact.&lt;br /&gt;
contact = Contact.get(id)&lt;br /&gt;
title = "Edit Contact"&lt;br /&gt;
else:&lt;br /&gt;
# if no id is specified, we're entering a&lt;br /&gt;
new contact.&lt;br /&gt;
contact = None&lt;br /&gt;
title = "New Contact"&lt;/p&gt;
&lt;p&gt;# In the following template code, please note&lt;br /&gt;
that we use&lt;br /&gt;
# Cheetah's $getVar() construct for the form&lt;br /&gt;
values. We have&lt;br /&gt;
# to do this because contact may be set to None&lt;br /&gt;
(see above).&lt;br /&gt;
template = Template('''&lt;br /&gt;
&amp;lt;h2&amp;gt;$title&amp;lt;/h2&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;form action="./store" method="POST"&amp;gt;&lt;br /&gt;
&amp;lt;input type="hidden" name="id"&lt;br /&gt;
value="$id" /&amp;gt;&lt;br /&gt;
Last Name: &amp;lt;input name="lastName"&lt;br /&gt;
value="$getVar('contact.lastName', '')" /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
First Name: &amp;lt;input name="firstName"&lt;br /&gt;
value="$getVar('contact.firstName', '')" /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Phone: &amp;lt;input name="phone"&lt;br /&gt;
value="$getVar('contact.phone', '')" /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Email: &amp;lt;input name="email"&lt;br /&gt;
value="$getVar('contact.email', '')" /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
URL: &amp;lt;input name="url"&lt;br /&gt;
value="$getVar('contact.url', '')" /&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;input type="submit" value="Store" /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
''', [locals(), globals()])&lt;/p&gt;
&lt;p&gt;return template.respond()&lt;/p&gt;
&lt;p&gt;edit.exposed = True&lt;/p&gt;
&lt;p&gt;def delete(self, id):&lt;br /&gt;
# Delete the specified contact&lt;br /&gt;
contact = Contact.get(int(id))&lt;br /&gt;
contact.destroySelf()&lt;br /&gt;
return 'Deleted. &amp;lt;a href="./"&amp;gt;Return to Index&amp;lt;/a&amp;gt;'&lt;/p&gt;
&lt;p&gt;delete.exposed = True&lt;/p&gt;
&lt;p&gt;def store(self, lastName, firstName, phone, email,&lt;br /&gt;
url, id = None):&lt;br /&gt;
if id and int(id) &amp;gt; 0:&lt;br /&gt;
# If an id was specified, update an&lt;br /&gt;
existing contact.&lt;br /&gt;
contact = Contact.get(int(id))&lt;/p&gt;
&lt;p&gt;# We could set one field after another, but&lt;br /&gt;
that would&lt;br /&gt;
# cause multiple UPDATE clauses. So we'll&lt;br /&gt;
just do it all&lt;br /&gt;
# in a single pass through the set() method.&lt;br /&gt;
contact.set(&lt;br /&gt;
lastName = lastName",&lt;br /&gt;
firstName = firstName,&lt;br /&gt;
phone = phone,&lt;br /&gt;
email = email,&lt;br /&gt;
url = url)&lt;br /&gt;
else:&lt;br /&gt;
# Otherwise, add a new contact.&lt;br /&gt;
contact = Contact(&lt;br /&gt;
lastName = lastName,&lt;br /&gt;
firstName = firstName,&lt;br /&gt;
phone = phone,&lt;br /&gt;
email = email,&lt;br /&gt;
url = url)&lt;/p&gt;
&lt;p&gt;return 'Stored. &amp;lt;a href="./"&amp;gt;Return to Index&amp;lt;/a&amp;gt;'&lt;/p&gt;
&lt;p&gt;store.exposed = True&lt;/p&gt;
&lt;p&gt;def reset(self):&lt;br /&gt;
# Drop existing table&lt;br /&gt;
Contact.dropTable(True)&lt;/p&gt;
&lt;p&gt;# Create new table&lt;br /&gt;
Contact.createTable()&lt;/p&gt;
&lt;p&gt;# Create some sample data&lt;br /&gt;
Contact(&lt;br /&gt;
firstName = 'testfirstName',&lt;br /&gt;
lastName = testLastName',&lt;br /&gt;
email = 'test@test.com',&lt;br /&gt;
phone = '555-1212',&lt;br /&gt;
url = '&lt;a href="http://www.nope.com" rel="nofollow"&gt;http://www.nope.com&lt;/a&gt;')&lt;/p&gt;
&lt;p&gt;return "reset completed!"&lt;/p&gt;
&lt;p&gt;reset.exposed = True&lt;/p&gt;
&lt;p&gt;print "If you're running this application for the first&lt;br /&gt;
time, please go to &lt;a href="http://localhost:8080/reset" rel="nofollow"&gt;http://localhost:8080/reset&lt;/a&gt; once in&lt;br /&gt;
order to create the database!"&lt;/p&gt;
&lt;p&gt;cpg.root = ContactManager()&lt;br /&gt;
cpg.server.start(configFile = 'tutorial.conf')&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Maureen Black</dc:creator><pubDate>Wed, 25 May 2005 00:51:34 -0000</pubDate><guid>https://sourceforge.net4855a260cbad3ccb1d79a7eae1d39562da23f789</guid></item><item><title>One-to-One Join</title><link>https://sourceforge.net/p/sqlobject/support-requests/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;This might be trivial - but can you show an example of&lt;br /&gt;
a one-to-one join using the _joins attribute.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 13 May 2003 21:12:29 -0000</pubDate><guid>https://sourceforge.net52d91fd7e3ccc69b8606bc46e6695fb9621f2860</guid></item></channel></rss>