ort hybrid_property
> >
> > class Plan(Base):
> > @hybrid_property
> > def calculated_date(self):
> > return date(self.year, self.month, self.day)
> >
> >
> > Also, in your query, don't use between:
> > session.query(Plan).\
>
On Fri, 4 Oct 2013 16:03:18 +0200
Enrico Morelli wrote:
> On Fri, 4 Oct 2013 16:25:00 +0300
> "Ofir Herzas" wrote:
>
> > I'm sorry, you should use hybrid_property:
> >
> > from sqlalchemy.ext.hybrid import hybrid_property
> >
> >
ion of sqlalchemy (0.6.8) that hasn't
the hybrid module. It's a dog that bites its own tail.
>
> -Original Message-----
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalchemy@googlegroups.com] On Behalf Of Enrico Morelli
> Sent: Friday, October 04, 2013 4:05 PM
>
perty' object has no attribute 'between'
>
> -Original Message-
> From: sqlalchemy@googlegroups.com
> [mailto:sqlalchemy@googlegroups.com] On Behalf Of Enrico Morelli
> Sent: Friday, October 04, 2013 12:07 PM
> To: sqlalchemy@googlegroups.com
> Subject: [sq
27;%s%s%s' % (to_date.year, tmonth, tday)
print fd, td
results = Session.query(Plan.data,
Plan.month,Plan.instrument_id,func.count(Plan.instrument_id)).filter(
and_((Plan.year*1000+Plan.month*100+Plan.day).between(from_date,
to_date), Plan.data.ilike('%%%s%%' % item),)).group_by(
)
but the result isn't real.
--
---
(o_
(o_ //\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+--+
| ENRICO MORELLI | email
On Wed, 23 Nov 2011 10:59:03 +0100
Enrico Morelli wrote:
> These are the mappers:
> mapper(Ligand, ligand_table,
>properties={
> 'ligand':relationship(LigandLigand,
> primaryjoin=and_(ligand_table.c.id==ligand_ligand_table.c.ligand_id1,
>
backref=backref('root')),
})
When I try to access to the ligand.ligand properties, this is empty
even if in the db there are relations. Where is the problem?
Thanks
--
---
(o_
(o_//\ Coltiva
On Tue, 20 Sep 2011 09:32:09 -0400
Michael Bayer wrote:
>
> On Sep 20, 2011, at 9:28 AM, Enrico Morelli wrote:
>
> >
> > Thanks, I tried to put passive_deletes='all' in the relationships:
> >
>
> sorry, 'pdb':relationship(Pdb, backref
On Tue, 20 Sep 2011 09:14:20 -0400
Michael Bayer wrote:
>
> On Sep 20, 2011, at 3:24 AM, Enrico Morelli wrote:
>
> > Dear all,
> >
> > I'm using SA 0.6.7 on a RHEL 6 with Python 2.6 and PostgreSQL 8.4.7.
> > These are some table of my DB:
> > pdb_
ror:
for code in open(pdblist):
pdb = Session.query(Pdb).filter(Pdb.code==code.strip()).all()
for p in pdb:
# Remove PDB
Session.delete(p)
Session.commit()
Where I wrong?
Thanks
--
-------
(o_
(o_//\ Coltivate Linux che tanto Windows si pi
On Fri, 6 May 2011 17:11:39 +0100
"King Simon-NFHD78" wrote:
> > -Original Message-
> > From: sqlalchemy@googlegroups.com
> > [mailto:sqlalchemy@googlegroups.com] On Behalf Of Enrico Morelli
> > Sent: 06 May 2011 16:20
> > To: sqlalchemy
--
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+----------+
| ENRICO MORELLI | email: more...@cerm.unifi.it |
| * * * *| phone: +39 0
On Wed, 9 Feb 2011 10:34:22 +0100
Enrico Morelli wrote:
> mapper(AtomInfo, atominfo_table,
>properties={
> 'residue': relationship(ResidueInfo, backref='atominfo'),
> 'periodic': relationship(Periodic, backref='atominf
om_atom_table,
properties={
'atom2': relationship(AtomInfo)
})
Thanks
--
---
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+-
.
(/)_ V_/_
+--+
| ENRICO MORELLI | email: more...@cerm.unifi.it |
| * * * *| phone: +39 055 4574269 |
| University of Florence| fax : +39 055 4574253 |
| CERM
e reports.
Thanks
--
---
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+--+
| ENRICO MORELLI | email: more...@cerm.uni
On Tue, 16 Nov 2010 11:37:12 -0500
Michael Bayer wrote:
>
> On Nov 16, 2010, at 6:16 AM, Enrico Morelli wrote:
>
> > On Mon, 15 Nov 2010 15:56:06 -0500
> > Michael Bayer wrote:
> >
> >> its looking for a Column object.menus_table.c.weight instead of
['lang'])).order_by(menus_table.c.weight.asc()).all()
but the error is the same:
ArgumentError: Column-based expression object expected for argument
'order_by'; got: 'weight', type
>
> On Nov 15, 2010, at 10:03 AM, Enrico Morelli wrote:
>
> > Dear all,
>
enus_permissions_table)
})
At the end the query:
main_menu = Session.query(Menu).filter(and_(Menu.parent_id==None,
Menu.lang==session['lang'])).order_by(Menu.weight.asc()).all()
--
---
(o_
(o_//\ Coltiva
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+--+
| ENRICO MORELLI | email: [EMAIL PROTECTED] |
| * * * *| phone: +39 055 4574269 |
| University of Florence| fax : +39
: 'integer[]'
--
---
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+------+
| ENRICO MORELLI | email: [EMAIL PROTECTED] |
| * * * *
ycopg in fact)
> maps timestamps with DateTime objects.
>
>
Thanks for your answer, but the problem is another.
It's my brain, I wrote c.user_id=u instead c.user=u.
I solved the problem.
> Enrico Morelli wrote:
> > Dear all,
> >
> > I've a strange problem with
start_date)s, %(protein)s, %(status)s, %(program)s)' {'status': 'R',
'workdir': '/home/morelli', 'user_id': <__main__.Users object at
0xb75d55cc>, 'calculation_id': 11L, 'job': '1234', 'pro
--
---
(o_
(o_//\ Coltivate Linux che tanto Windows si pianta da solo.
(/)_ V_/_
+--+
| ENRICO MORELLI | email: [EMAIL PROTECTED] |
| *
25 matches
Mail list logo