I need to change a collection order_by when a parent instance mapped
attribute changes.
Something like this:
parents = Table('parents', metadata,
Column('id', Integer, primary_key=True)
Column('reverse', Boolean, primary_key=True)
)
items =
On Oct 25, 2011, at 5:02 AM, neurino wrote:
I need to change a collection order_by when a parent instance mapped
attribute changes.
Something like this:
parents = Table('parents', metadata,
Column('id', Integer, primary_key=True)
Column('reverse
add all children
every time I instantiate a new parent?
Thanks for your support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email
it belongs I wish I can create also needed UserLayers accordingly to save
relative data.
Little mind map: http://postimage.org/image/286v46m10/
Thanks for your support
neurino
On Tue, Oct 4, 2011 at 3:17 PM, Michael Bayer mike...@zzzcomputing.comwrote:
On Oct 4, 2011, at 8:21 AM, neurino wrote
neurino
On Tue, Aug 2, 2011 at 9:43 AM, neurino neur...@gmail.com wrote:
Sorry Michael,
there was a typo in my code, due to some wrong copy/paste or search/replace
I guess, I'm afraid.
The error I reported comes up mapping to `TransmLimit` and not `SurfaceRes`
(which is the one already
patience.
neurino
On Mon, Aug 1, 2011 at 11:14 PM, Michael Bayer mike...@zzzcomputing.comwrote:
'transm_limit': relationship(SurfaceRes, single_parent=True,
#uselist=False,
#primaryjoin=and_(
#user_stratigraphies.c.id_prov==provinces.c.id
=True`
initialization fails.
I just need these to get (not even set) some values with convenience
of SA attributes.
I published a working example on pastebin:
http://pastebin.com/RsZ6GCRq
I hope someone can sort out this thing, thank you.
Greetings
neurino
--
You received this message because
table (holding type name
adn so on) or not?
Probably reading docs better I'd get the answer by myself so don't mind...
I'll post results if I reach some good point.
Thanks again
neurino
On Fri, Jul 29, 2011 at 4:12 PM, Michael Bayer mike...@zzzcomputing.comwrote:
On Jul 28, 2011, at 7:05 PM
this with two mappings?
Any advice?
Thanks for your support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr
Thanks Michael,
my need is quite easy, no need of complex querying.
Simply my class represents a Layer and, while quite all layer types
(concrete, wood, bricks, etc.) act the same, only one (air) acts in a
completely different way.
With act I refer to performing calculations on float
id_type (one of `row` items) in
see_what_type.
Any advice?
Thanks for your support
On Fri, Jul 29, 2011 at 12:15 AM, Michael Bayer mike...@zzzcomputing.comwrote:
On Jul 28, 2011, at 6:08 PM, neurino wrote:
Thanks Michael,
my need is quite easy, no need of complex querying.
Simply my class
I have a (deep) tree structure
main
area
category
criteria
inputs
all tables with one_to_many relationships except criteria - inputs
which is many_to_many.
I need to set up a relationship for `main` as list of all distinct
inputs of its sub-sub-sub-criteria as in this query:
bug, something
sqlalchemy related or whatever.
I know I set `passive_deletes=True`to get MySQL ONDELETE CASCADE take
care of it more and more quickly.
Any help appreciated, thanks for your support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy
tables definitions 'll look
like:
sensors = Table('sensors', metadata,
...
mysql_engine='InnoDB'
)
view_opts = Table('view_opts', metadata,
...
mysql_engine='InnoDB'
)
On 30 Maj, 17:38, neurino neur...@gmail.com wrote:
I have a composite Primary key
support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit
,
data.c.id_acq==acquisitions.c.id,
acquisitions.c.id_cu==sensors.c.id_cu),
cascade='all, delete-orphan', single_parent=True)
})
Now it seems work as expected, thanks.
On Feb 28, 1:03 pm, neurino neur...@gmail.com wrote:
Sorry if I resume this after two months but I
I guess since, I learn it now, EXCEPT is not supported by MySQL...
I guess I'll have to change my query at all...
On Feb 22, 12:57 pm, neurino neur...@gmail.com wrote:
I have now problems with except_ in MySQL: the code that worked flawlessly
in sqlite now causes an error, seems right after
,
model.Sensor.id_meas==stmt.c.id_meas))) \
.filter(and_(stmt.c.id_cu==None, stmt.c.id_meas==None))
Cheers
2011/2/22 neurino neur...@gmail.com
I guess since, I learn it now, EXCEPT is not supported by MySQL...
I guess I'll have to change my query at all...
On Feb 22, 12:57 pm, neurino neur...@gmail.com
I'm switching to MySQL from SQLite in my Pylons app and I get this
error during setup-app:
sqlalchemy.exc.InvalidRequestError: VARCHAR requires a length when
rendered on MySQL
I noticed some tables had simply Unicode without length but also
adding length to all Unicode columns the error keeps
Please ignore this issue, searched for all Unicode but forgot I also
used a String for a column...
It works flawlessly, I apologize.
On Feb 21, 12:40 pm, neurino neur...@gmail.com wrote:
I'm switching to MySQL from SQLite in my Pylons app and I get this
error during setup-app
, 'cascade', ()):
print name
Thanks again you for your support
On Feb 3, 6:04 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 3, 2011, at 11:58 AM, neurino wrote:
That is great!
Just for eventual followers I fix imports:
from sqlalchemy.orm import
while it shouldn't...
Any tips?
Thank you for your support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr
the user is smart enough to know that if
he deletes an Acquisition he deletes its data too...
I'm looking at cascade_iterator def source, I could hack that end
enclose directly in my code, the halt_on parameter is unused, as far
as I understand.
Thanks for your support
neurino
On Feb 3, 5:19 pm
(
Session.query(model.Sensor) \
.filter(model.Sensor.id_cu==model.ViewOpt.id_cu) \
.filter(model.Sensor.id_meas==model.ViewOpt.id_meas) \
.filter(model.ViewOpt.id_view==1)
)
and works perfectly, thanks again!
Cheers
neurino
On Jan 12, 5:28 pm, Michael Bayer mike
I have this model:
``I organize views with many view_options each one showing a sensor.
A sensor can appear just once per view.``
sensors = Table('sensors', metadata,
Column('id_cu', Integer, ForeignKey('ctrl_units.id'),
primary_key=True,
autoincrement=False),
` which are order_by compatible?
Thanks for your support
On Jan 12, 2:38 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Jan 12, 2011, at 7:28 AM, neurino wrote:
I have this model:
``I organize views with many view_options each one showing a sensor.
A sensor can appear just once
...@zzzcomputing.com wrote:
On Jan 12, 2011, at 8:46 AM, neurino wrote:
I need always the same order_by in all app and it could be subject of
modification and / or integration in the near future so which better
place than mapper to define it once instead of any time I do a query?
It sounds like
Thank you Michael,
I will try it... next year... ^^
good 2011 again!
neurino
On Dec 30, 5:45 pm, Michael Bayer mike...@zzzcomputing.com wrote:
this is again my error messages not telling the whole story, ill see if i can
get the term foreign_keys back in there:
mapper(Sensor, sensors
I have this 4 tables, the base concept is:
`sensor data comes from its id_meas / id_cu pair, I can find id_meas
directly in data and id_cu in data parent acquisition.`
data = Table('data', metadata,
Column('id', Integer, primary_key=True),
Column('id_acq', Integer,
How can I execute a query like if I'm using the normal python DB API,
passing params as a sequence and not as a mapping?
Something like:
myParams = (1, 1, 2, 51, 3, 101, 4, 151, 6, 201, 7, 251)
Session.execute(
SELECT T.datetime, MAX(T.v0), MAX(T.v1), MAX(T.v2), MAX(T.v3),
MAX(T.v4),
style at all. You'd need to consult its documentation
for details.
When using Session, acquire the current connection using conn =
Session.connection().
On Dec 20, 2010, at 8:10 AM, neurino wrote:
How can I execute a query like if I'm using the normal python DB API,
passing params
Thanks for links, I found `aliased` in docs but not in tutorials,
I got errors using it but probably I was using it in the wrong way,
now it's clearer.
On Dec 16, 2:39 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 15, 2010, at 9:04 AM, neurino wrote:
Hello I have 2 tables: data
, data, properties={
'acquisitions': orm.relationship(Acquisition, backref='data'),
})
orm.mapper(Acquisition, acquisitions)
Any advice?
Thanks for your support
neurino
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group
I get an OperationalError trying to use tuple_ and in_ in a query with
a
Sqlite db.
This is the query (select the distinct id_acq - id_centr couples not
already present in another table)
query = model.Session.query(
Dato.id_elab, Acquisizione.id_centr)\
guess I need to retrieve data from both queries in 2 sets
and make difference() between them.
Thanks
On Dec 9, 3:28 pm, neurino neur...@gmail.com wrote:
I get an OperationalError trying to use tuple_ and in_ in a query with
a
Sqlite db.
This is the query (select the distinct id_acq - id_centr
`
to get type description, if any, so I realize probably the
relationship is not really needed...
Any advice welcome anyway...
Thank you
On Dec 2, 3:55 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 2, 2010, at 6:48 AM, neurino wrote:
Let's say I have acquisitions at regular intervals
Let's say I have acquisitions at regular intervals and each
acquisition I get different measures.
Each meausre has a value and a numeric type id (1 = temperature, 2 =
humidity ecc...)
I want user to insert text description for type id he knows, if he
wants.
I end up having this 3 tables:
Thanks Michael,
this solved most of my doubts.
Greetings
neurino
On Nov 16, 5:51 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Nov 16, 2010, at 4:19 AM, neurino wrote:
I didn't mean mapping Root to a Table (if not necessary) is my intent,
what I'd like to know is how to get
]
session.delete(root.areas[0])
session.commit()
root.items
[area]
I hope I has been able to focus on my question now.
Thanks for your help
neurino
On Nov 15, 9:57 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Nov 15, 2010, at 10:46 AM, neurino wrote:
Thanks for your answer first.
Root
So no advice?
Are relationships and backref something more than attributes I can
setup with a query?
Thank you for your support.
On Nov 11, 9:45 am, neurino neur...@gmail.com wrote:
I have a tree structure
Root
|
+--Area
| |
| +--SubArea
| | |
| | +--Item
in the situation that 80%
of the work is done by sqlalchemy automatically and I'm not sure how
to fill the remaining, possibly having both areas and subareas behave
at the same way to avoid confusion (just as an example, lazy loading).
Thanks for your support
neurino
On Nov 15, 3:49 pm, Michael
= query(Area).all()
for area in self.areas:
area.parent = self
But it won't be the same thing as sqlalchemy `relationship` attributes
so:
are there alternative solutions more sqlalchemy-like?
Any tip appreciated!
Thank you for your support
Greetings
neurino
--
You received this message
42 matches
Mail list logo