Hi!
I have defined my models in Pyramid like this:
# coding: utf-8
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Integer, Float, DateTime, ForeignKey,
ForeignKeyConstraint, String, Column
from sqlalchemy.orm import scoped_session, sessionmaker, relationship,
I am trying to convert the following SQL statement into an Sqlalchemy ORM
(Version 0.7.4) statement:
SELECT [hermes_stage].[dbo].[run].[tank]
,[id]
,[experiment_id]
,[local_id]
,[start_time]
,[stop_time]
FROM [some_db].[run]
INNER JOIN (
Select
I have a sqlalchemy query using a subquery listed below:
test = model.session.query(func.max(SomeEntity.start_time),
SomeEntity.name).filter(Run.name.in_(['some
name'])).group_by(SomeEntity.name).with_labels().subquery(name = 'sub')
SomeEntity.query().join(test,
Sorry for the multiple attempts at posting. I am not sure if posts are time
delayed but I am not seeing what I thought I posted. So I am trying one
more time. I am trying to convert the following SQL statement into an
Sqlalchemy ORM (Version 0.7.4) statement:
SELECT
I am trying to convert the following SQL statement into an Sqlalchemy ORM
(Version 0.7.4) statement:
SELECT [hermes_stage].[dbo].[run].[tank]
,[id]
,[experiment_id]
,[local_id]
,[start_time]
,[stop_time]
FROM [some_db].[run]
INNER JOIN (
you can alter how MetaData things are built up using the after_parent_attach
event:
http://docs.sqlalchemy.org/en/rel_0_9/core/events.html?highlight=after_parent_attach#sqlalchemy.events.DDLEvents.after_parent_attach
apply the event to ForeignKey and set use_alter=True for all of them as they
Hi,
When i pass a Non-ASCII string in where condition filter of an raw SQL
statement, the SQLALCHEMY showing below error during an execution of query
File
/base/data/home/apps/s~ipaddress/versionnumber/flow/services/requestExport.py,
line 119, in getRecordsFromDB
instanceList =
Thanks for the reply. I had implemented this feature about two months ago,
and I had forgotten myself. I had originally used this:
def rand_hex_str():
return '%016x' % random.getrandbits(64)
# using event listener to force foreign key definitions to use 'alter
statements'
def
On Aug 27, 2014, at 3:38 PM, Bala Ramakrishnan bal...@gmail.com wrote:
Thanks for the reply. I had implemented this feature about two months ago,
and I had forgotten myself. I had originally used this:
def rand_hex_str():
return '%016x' % random.getrandbits(64)
# using event
Thanks for the quick response Michael.
One more question, if you don't mind:
I updated my gist to demonstrate this problem:
https://gist.github.com/chadrik/08617b6ed4d9cbacd93c
To sum it up, I added a one-to-many relationships between Books and
Chapters, but the relationships which show items
On Aug 27, 2014, at 5:31 PM, Chad Dombrova chad...@gmail.com wrote:
Thanks for the quick response Michael.
One more question, if you don't mind:
I updated my gist to demonstrate this problem:
https://gist.github.com/chadrik/08617b6ed4d9cbacd93c
To sum it up, I added a one-to-many
I have a pretty simple goal, so simple I probably don't even need example
code.
I have 2 classes, and I want to pull the identity key from an instance of
one class, and use the values to create an instance of the second, without
requiring (or introspecting) things like the PK names, FK names
On Aug 27, 2014, at 6:17 PM, Gerald Thibault dieselmach...@gmail.com wrote:
I have a pretty simple goal, so simple I probably don't even need example
code.
I have 2 classes, and I want to pull the identity key from an instance of one
class, and use the values to create an instance of the
On Wednesday, August 27, 2014 4:58:50 PM UTC-7, Michael Bayer wrote:
On Aug 27, 2014, at 6:17 PM, Gerald Thibault diesel...@gmail.com
javascript: wrote:
I have a pretty simple goal, so simple I probably don't even need
example code.
I have 2 classes, and I want to pull the
Also, this might help to clarify my goal, this is my current working code
that accomplishes the desired result, but with more introspection than I
was hoping for. If there isn't something easier, this will work.
# instance1 is an instance of Class1, i want to create Class2 with the same
pk
15 matches
Mail list logo