_ + matchobj.group(0).lower()
if text:
text = text[0].lower() + re.sub(r'([A-Z])', downcase, text[1:])
return text
On Jan 5, 2011, at 2:41 PM, Petr Kobalíček wrote:
Hi,
I'm using underscored_separator_convention in a database, but
camelCase in python code.
I created small wrapper
Hi,
I'm using underscored_separator_convention in a database, but
camelCase in python code.
I created small wrapper across a table column so I don't need to
define columns using a key property:
from sqlalchemy import Column as SqlColumn
def underscored(s):
result = u
for i in xrange(0,
Hi Mark,
I think I badly described what I'm doing. My problem is that I need to
update some columns atomically and I'm using stored procedures for
that. I'm still learning the postgres so maybe I'm doing so complex
things for so simple tasks.
As a very short and simple example:
RecordTable:
Hi,
I have problem to understand which way should be used to write custom
DDL class. I'm generating some stored procedures for my tables. The
procedures are very similar and I'd like to use some generic way. Now
I'm nearly done, but I need some way how to extract some information
from table to
, Sep 1, 2010 at 2:15 AM, Petr Kobalíček kobalicek.p...@gmail.com wrote:
Hi,
I have problem to understand which way should be used to write custom
DDL class. I'm generating some stored procedures for my tables. The
procedures are very similar and I'd like to use some generic way. Now
I'm nearly
Hi Michael,
many thanks for explanation.
I considered what you wrote and now I'm making my own class as a
callable and I'm going to use append_ddl_listener(). This means I
don't need DDLElement and DDL.
Best regards
Petr
--
You received this message because you are subscribed to the Google
Hi devs,
how to get column type from a column instance?
Imagine following table:
RecordTable = Table('t_record', metadata,
Column('record_id', Integer, primary_key = True),
Column('dep', Integer, default=None)
)
I can get my column using:
engine = engine_from_config({
sqlalchemy.url:
Thanks again!
You saved me really a lot of time.
Best regards
Petr Kobalicek
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
= {
id: RecordTable.c.record_id,
idx: RecordTable.c.idx, MARK ReadOnly?
msg: RecordTable.c.msg
}
)
Thanks a lot
Best regards
Petr Kobalicek
On Mon, Aug 30, 2010 at 4:51 AM, Petr Kobalíček
kobalicek.p...@gmail.com wrote:
Hi devs,
thanks for replies!
Michael: I asked
Hi devs,
I added %% into my DDL and sqlalchemy raises the TypeError: 'dict'
object does not support indexing.
The critical part is:
row_array t_record%%ROWTYPE in the DDL.
Em I using the DDL correctly? I read that I need to double the '%'
character and I did that.
Best regards
Petr
Hi Michael,
thanks for reply, I tried triple escaping before I posted the first
message, but the error is the same.
Interesting is fact that i can add 20 '%' characters into the DDL but
in SQL INFO I always see only one '%'.
Is there other workaround? Can I safely replace the line described in:
Hi Michael,
triple escaping works, sorry for misinformation.
Best regards
Petr
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
Hi devs,
is there a simple way how to make an ORM property read only? I need to
fetch the column from database so it will be accessible through the
mapped class, but I need that the property will be never updated back
to the database (in case I add the object to the session and do
commit).
Hi devs,
I need to write a query where two tags match one product. I wrote
simple test-case I'm using with sqlite:
#!/usr/bin/env python
from sqlalchemy import *
from sqlalchemy.sql import and_, or_
engine = create_engine(sqlite://, echo=True)
metadata
and I have:
query = select([ProductTable])
...
How can I extend this query by the query shown above?
Thanks
- Petr
On Mon, Jun 28, 2010 at 9:40 AM, Petr Kobalíček
kobalicek.p...@gmail.com wrote:
Hi devs,
I need to write a query where two tags match one product. I wrote
simple test-case
Hi devs,
I have one problem related to join and adding conditions (sorry for
misleading subject, I don't know how to describe it shortly).
I have two tables:
Product
Tag
There is many to many relation between tag and products and I need to
select product where two tags are set. How to do
So, I can use that way in inserting one row, but can't when inserting
multiple rows ? It is correct ?
2008/11/24 Michael Bayer [EMAIL PROTECTED]:
oh, right. Column objects only work when you say insert().values(**dict).
MikeCo wrote:
Using 0.5.0rc4 doesn't seem to do that. or what am I
Hi devs,
I don't understand one thing:
I have table:
CartItemTable = sql.Table(
CartItem, meta.metadata,
# Relations
sql.Column(userId , sql.Integer ,
sql.ForeignKey(User.userId), nullable=False, primary_key=True),
sql.Column(productId , sql.Integer ,
Hi Chris,
yeah these tools works great, our problem was that if I did backup and
restoration from web interface then this problem happen.
I wasn't also familiar with postgres :)
Cheers
- Petr
2008/11/10 Chris Miles [EMAIL PROTECTED]:
On Nov 10, 4:57 am, Petr Kobalíček [EMAIL PROTECTED
Thank you Michael.
2008/11/9 Michael Bayer [EMAIL PROTECTED]:
you need to call ALTER SEQUENCE on your sequences such that they begin
with an integer identifier greater than that of the table they are
being used with.
On Nov 9, 2008, at 1:22 PM, Petr Kobalíček wrote:
I have found some
Hi devs,
I have postgres related problem. I'm normally developing with sqlite,
but we are using postgres on the server. The problem is that
sqlalchemy probably remembers primary keys and after database restore
it will start in all tables from 1.
The error is (IntegrityError) duplicate key
I have found some material about this and this is called 'sequences'
in postgres terminology.
So I know the problem, but I don't know how to synchronize sequences
using sqlalchemy.
Cheers
- Petr
2008/11/9 Petr Kobalíček [EMAIL PROTECTED]:
Hi devs,
I have postgres related problem. I'm
22 matches
Mail list logo