relationship.
> At the ORM level, *this direction is reversed*. SQLAlchemy handles the
> deletion of “child” objects relative to a “parent” from the “parent” side,
> which means that delete and delete-orphan cascade are configured on the
> *one-to-many* side
Marc V.
--
SQLA
simply add the
*ondelete='CASCADE'* and expect the same behavior as before ?
Best regards,
Marc V.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Exa
. Your
suggestion will be helpful
On Monday, July 16, 2018 at 5:24:16 PM UTC+1, Jonathan Vanasco wrote:
>
>
>
> On Monday, July 16, 2018 at 4:53:18 AM UTC-4, Marc wrote:
>>
>> Thank you both Jonathan and Kirk for your helpful comments. I am leaning
>> more and more towa
requirements
and provide additional functionality for 'free'
On Sunday, July 15, 2018 at 12:20:56 PM UTC, Kirk wrote:
>
> On 14 July 2018 at 19:45, Marc > wrote:
>
> The application has the requirement that authorised users can add
>> information to the database, but
Hi,
Building a web application with PostgreSQL 9.6, SQLAlchemy, Flask and a
HTML5 javascript/jquery front-end.
The application has the requirement that authorised users can add
information to the database, but this information should not be displayed
on the public web pages until an admin has
Mike,
Thanks for the patch! I won't get a chance to try it 'till probably Monday,
but it looks good. I'll send a note when I've had a chance to try it.
--
Marc W. Mengel
Computer Services Senior Developer
Data Management and Applications
Fermi National Accelerator Lab
So I had a query in raw PostgreSQL which was trying to find the start and
end of an event in
a history table:
select jh.job_id, jh.created as start_t, jh.status, min(jh.created)
over (PARTITION by jh.job_id
ORDER BY jh.created
$
LANGUAGE plpythonu STABLE
COST 100;
ALTER FUNCTION util.unpickle(bytea)
My question for sqlalchmy or is this psycopg2 question?
is there any data manipulation that is happened before the pickle.loads
function gets called? so is there any processing happening before
def result_processor(sel
hi,
after further investigating this didn't turn out to be the issue. ORM code
was adding the extra keys in the dictionary.
you can consider the issue closed,
sorry for the noise.
marc
On Friday, October 17, 2014 12:11:05 AM UTC-4, Marc Van Olmen wrote:
>
> Second attempt bec
Second attempt because Google Groups doesn't seems to show my question.
hi,
I'm running into an issue where unpickle a column from slqalchmey managed
database in python 2.7.5 + sqlaymchy 0.9.3 + posgresql 9.2.3
is giving different result when I use sqlalchemy to load the pickled column
or when
I did some more digging today to see If I can pin down the exact reason:
I tested with a unit test, and reduced the code above to bare minimum and
not doing references to collections anymore.
def serials(self):
requiredAmountOfSerials = self.quantity
if requiredAmountOfSeria
ed by
afterSerials = self._serials
Then followed by:
Session.flush()
So It is similar to what you described,
Thanks again.
marc
On Saturday, October 12, 2013 6:41:19 PM UTC-4, Michael Bayer wrote:
>
>
> On Oct 12, 2013, at 11:54 AM, Marc Van Olmen
> >
> wrote:
>
> &
==
request_table.c.id, lazy=False),
}
mapper_cached(
MetaSerial,
metaserial_table,
# save_on_init=False,
properties={
'employee': relationship(
Item, primaryjoin=item_table.c.id ==
metaserial_table.c.id_employee
),
'_value
non_1 UNION ALL SELECT DATEADD(dd, ?, date)
AS [DATEADD_1]
FROM all_dates
WHERE DATEADD(dd, ?, date) <= CAST(? AS DATETIME)
)
SELECT date AS date
FROM (SELECT * FROM all_dates) as x
WHERE date>='2011-01-15 00:00:00' ORDER BY date DESC
OPTION (MAXRECURSION 0)
On Thu, Aug 18, 2011 at
used a regular expression to shim in a special comment. This
seems hackish but could a similar approach work on mssql? Is it possible to
hook into only the top-level/last Select's compile()?
Thanks for all of your help.
-Marc
On Thu, Aug 18, 2011 at 1:37 PM, Michael Bayer wrote:
>
> On Aug
step, date) <= CAST(:stop AS DATETIME)
)
SELECT * FROM all_dates
OPTION (MAXRECURSION 0)
On Thu, Aug 18, 2011 at 1:08 PM, Marc DellaVolpe
wrote:
> From what I can tell from
> http://msdn.microsoft.com/en-us/library/ms190766.aspx and experimentally,
> you can only put CTE's at the top
a CTE to the select and then generating
custom SQL for the subclass but I wasn't completely familiar of the
compilation workings to determine if this was workable solution to force the
CTE to the top of the generated SQL.
-Marc
On Thu, Aug 18, 2011 at 12:13 PM, Michael Bayer wrote:
>
>
"DATEADD_1"
FROM all_dates
WHERE DATEADD(dd, %(step)s, all_dates.date) <= CAST(%(stop)s AS TIMESTAMP
WITHOUT TIME ZONE))
SELECT anon_1.date AS anon_1_date
FROM (SELECT * FROM all_dates) AS anon_1
-Marc
On Thu, Aug 18, 2011 at 11:47 AM, Michael Bayer wrote:
>
> On Aug 18, 2011, a
selects to
transform queries. I have only been able to make the mapping work
with .from_statement() however this does not allow for
transformations.
Any thoughts?
Thanks,
-Marc
with CommonTableExpression.create('all_dates', ['date']) as all_dates:
start_exp = cast(bindpara
(joinedload_all(User.orders, Order.items, Item.keywords))
I would like to do something like:
query.options(joinedload_all('orders.items.keywords')).order_by('user.orders.items.keywords.name')
Tried this above but didn't work. Searched for some sample/tutorials
but with n
On Fri, 2010-10-22 at 17:07 -0700, Michael Bayer wrote:
>
> On Oct 22, 6:58 pm, Marc Munro wrote:
> [ dumb question deleted ]
> why not map a class to your view/table/select statement in the normal
> fashion ?
>
> tables:
> http://www.sqlalchemy.org/docs/orm/tutorial.htm
but session.Query does
not want to play nice with me.
The only idea I have right now is to define a new Query object which can
figure out if its been called for a SimpleQuery and take appropriate
action. That seems really sucky though.
Anyone have any better ideas? Better yet, has anyone done thi
ostgresql
I ran into the same error trying to build a Windows executable with
py2exe. I fixed it by explicitly importing the postgresql dialect and
psycopg2:
from psycopg2 import *
from sqlalchemy.dialects.postgresql import *
-Marc
--
You received this message because you are subscribed to the G
hello all,
We are using "business object" , a decisionnal layer upon our databases.
I can connect to BO backend with odbc and execute sql order.
is SQLAlchemy is able to connect to an ODBC driver other than MSSQL
driver?
I try also with mysql odbc driver unsuccessfully.
thanks for your answ
helo SQLAlchemylist,
I want to purge my mysql database and delete record selected by date
with a select_by
In [56]: query_etats.selectfirst().create_date
Out[56]: datetime.datetime(2007, 7, 31, 17, 24, 32)
In [57]: madate
Out[57]: datetime.datetime(2007, 8, 21, 18, 33, 9, 542421)
In [58]: pr
j
> Here you're holding onto open cursors with 'something ==
> ordinateurs.fetchone()'. Either explicitly close() the two result sets
> you're accessing with fetchone() or remove your reference to the rows
> and python gc will get around to closing the cursors at some point.
>
>
ok thanks.
helo,
I don't understand why my sqlite database is locked on a drop ( the code
is following)
thanks for your explanation.
007-09-14 18:26:36,375 INFO
sqlalchemy.engine.threadlocal.TLEngine.0x..f0 ROLLBACK
Traceback (most recent call last):
File
"C:\Python25\Lib\site-packages\pythonwin\pywin
27 matches
Mail list logo