Hi all,
Probably this is a stupid question, :-[
but I don't understand how to iterate an object mapper to get fields value.
---
user = session.query(User).select(id=1)
for j in user.c:
print j.name
logname
id
password
for j in user.c:
print j.value
'Column' object has no attribute
Hi all,
Probably this is a stupid question, :-[
but I don't understand how to iterate an object mapper to get
fields value. ---
user = session.query(User).select(id=1)
for j in user.c:
print j.name
logname
id
password
these are the column-names that your query-result has. It is
Jose Soares wrote:
Hi all,
Probably this is a stupid question, :-[ but I don't
understand how to iterate an object mapper to get fields value.
---
user = session.query(User).select(id=1)
for j in user.c:
print j.name
logname
id
password
for j in user.c:
print
Hi all,
I would like to display my dates with format '%d/%m/%Y' instead of ISO
format.
qry = session.query(Nazione).select(Nazione.c.codice=='201')
qry[0].data_inizio
print qry[0].data_inizio
2006-01-14
Is there a way to set it in SA without using a customer function ?
jo
On Wed, 2007-31-01 at 17:50 -0400, Jose Soares wrote:
Hi all,
I would like to display my dates with format '%d/%m/%Y' instead of ISO
format.
qry = session.query(Nazione).select(Nazione.c.codice=='201')
qry[0].data_inizio
print qry[0].data_inizio
2006-01-14
Is there a way to set
On Wed, 2007-31-01 at 12:17 -0500, Guy Hulbert wrote:
I would like to display my dates with format '%d/%m/%Y' instead of
ISO
format.
qry = session.query(Nazione).select(Nazione.c.codice=='201')
qry[0].data_inizio
print qry[0].data_inizio
2006-01-14
Is there a way to set
sorry, there was one more quoting fix that was needed. passes with
PG on 2274.
IMO even some more.
see ansisql.py, format_column(), any sqlalchemy.sql._ColumnClause
falls into the literal case, and is not quoted (try with zz.py, the
py_a.dataC).
Also see schema.py, the copy() and the
I have a mapped class.. lets call it Data with a few properties
Data.id (primary key), Data.a, Data.b, Data.c
I want to query a few of these objects out.. but they need to be
sorted by some arbitrary data
arbitrary_data=select ( [Data.c.id, OtherClass.c.somedata],
another things i noted:
- using value.lower() == value instead of value.islower()
- ansisql.py:
in _requires_quotes():
this
bool(len([x for x in str(value)
if x not in self._legal_characters()]))
should be same as
bool( s.translate( 256*' ', self._legal_characters() ) )
what are there like 10 .py attached scripts that ive to look at now ?
ive completely lost track. post tickets for the important ones.
On Jan 31, 12:42 pm, svilen [EMAIL PROTECTED] wrote:
sorry, there was one more quoting fix that was needed. passes with
PG on 2274.
IMO even some more.
On Jan 31, 1:28 pm, svilen [EMAIL PROTECTED] wrote:
another things i noted:
- using value.lower() == value instead of value.islower()
- ansisql.py:
in _requires_quotes():
this
bool(len([x for x in str(value)
if x not in self._legal_characters()]))
should be same as
quick easy fix is to use result set mapping instead, or feed a full
select() statement into query.select(), which will skip the whole
compilation step.
i would like a small test case attached for this one so i can play
with it, though. for example i dont see why its deciding to use the
nesting
Sorry if this posts twice... I didn't get a Message has been sent
page last time..
I posted a bug with a test case here:
http://www.sqlalchemy.org/trac/ticket/449
Thanks
Dennis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
I've created a bug with an attached test:
http://www.sqlalchemy.org/trac/ticket/449
Thanks!
-Dennis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
hi, i've got it this far now. but it doesnt like the q.address.lat/lon
since it makes an alias in the join. how to i get at that alias?
sajoin = q.join_to('address')
sorder = ABS( + str(q.address.lat) + - %f) + ABS( +
str(q.address.lon) + - %f)
sorder %= (lat,lon)
Just a quick note, I tried out your suggestion to pass in a select
statement.
That does indeed work. There is an issue though, I tried using the
contains_eager('myproperty') as noted in the docs and that only worked
in combination with eagerload('myproperty'). I think the reason is
that in the
On Jan 31, 4:57 pm, Dennis [EMAIL PROTECTED] wrote:
little confusing, but perhaps it is supposed to be that way. I would
have thought that contains_eager implies eagerload.
great idea. i threw that into rev 2284.
--~--~-~--~~~---~--~~
You received this
another things i noted:
- using value.lower() == value instead of value.islower()
- ansisql.py:
in _requires_quotes():
this
bool(len([x for x in str(value)
if x not in self._legal_characters()]))
should be same as
bool( s.translate( 256*' ',
use func.abs(q.address.lat) for the ABS function.
On Jan 31, 2007, at 4:24 PM, Brent Pedersen wrote:
hi, i've got it this far now. but it doesnt like the q.address.lat/lon
since it makes an alias in the join. how to i get at that alias?
sajoin = q.join_to('address')
ah. that makes sense.
here's my working query. returns results in order of distance to a
point (lat,lon):
q = session.query(Student)
j = q.join_to('address')
return q.select(
j,order_by=asc(func.abs(address.c.lat -lat) +
func.abs(address.c.lon-lon))
20 matches
Mail list logo