A how to question.
I'd like to be able to create a table which has dynamic primary keys.
Something along these lines.
Lets say the main table is called Master. it has a generated id.
Then a table that is an id and a name, called AliasType.
It's then a many to many association between Maste
Hm, I'll spend some time playing around with enable_relationship_loading
and see if I can produce what I'm looking for. Thanks again for the help!
On Tuesday, August 7, 2018 at 12:47:52 PM UTC-5, Mike Bayer wrote:
>
> On Mon, Aug 6, 2018 at 8:01 PM, Nick Repole > wrote:
ith any
changes being tracked/persisted,so such a scenario would accomplish what
I'd need. But I realize my use case is pretty niche.
On Monday, August 6, 2018 at 9:58:33 AM UTC-5, Mike Bayer wrote:
>
> On Sat, Aug 4, 2018 at 11:27 PM, Nick Repole > wrote:
> > Hi,
> >
>
Hi,
I'm attempting to load some filtered relationships, and am running into
issues when trying to independently load the same relationship multiple
times.
As an example, I'd like to load Album.tracks, and Album.tracks.album.tracks
in different ways. In the first tracks relationship, I'm trying
ng a dict for student lookup, and then joining it
to each student in the for loop.
I hope this gives a better understanding into the problem I'm trying to
solve.
Thanks for your help so far!
On Wednesday, June 15, 2016 at 11:35:01 PM UTC+10, Mike Bayer wrote:
>
>
>
&
Hey,
I'm working on a more complex problem with the ORM functionality of SQLA.
I have a reasonably simple relationship, ie,
class A(Base):
id = sa.Column(sa.Integer(), primary_key=True)
b_collection = sa.orm.relationship('B')
class B(Base):
id = sa.Column(sa.Integer(), primary_k
_wednesday, calendars.thurday AS calendars_thurday,
calendars.friday AS calendars_friday, calendars.saturday AS
calendars_saturday, calendars.sunday AS calendars_sunday
FROM calendars, calendar_children
WHERE calendar_children.parent_id = ? AND calendar_children.child_id =
calendars.id*
2011-0
Thanks Michael,
I'll check the two articles out tonight
Nick
On 25 November 2010 17:05, Michael Bayer wrote:
>
> On Nov 25, 2010, at 11:02 AM, Nickle wrote:
>
>> I'm trying to get my head around idempotent updating.
>>
>> ie I'm creating some ob
Pretend I bound that metadata and session to an engine at some
point...
On Jun 3, 12:59 pm, Nick Retallack wrote:
> On Jun 3, 8:53 am, Michael Bayer wrote:
>
> > > Is it a common practice to pass the current session into the
> > > constructor of an ORM model?
>
>
On Jun 3, 8:53 am, Michael Bayer wrote:
> > Is it a common practice to pass the current session into the
> > constructor of an ORM model?
>
> no. The session consumes your objects, not the other way around. An object
> can always get its current session via object_session(self).
>
> > At thi
I have a lot of questions, so bear with me. I've been having some
doubts about whether I'm really using sqlalchemy in a good way.
--
Is there any use case for having more than one session active in the
same thread? Or does everyone use threadlocal sessions? If you bind
different tables to diff
Thanks for all the info. I feel a lot better about using this orm now
=]
On Dec 24, 7:50 pm, Michael Bayer wrote:
> On Dec 24, 2009, at 3:44 PM, Nick Retallack wrote:
>
> > I've looked at sqlalchemy-migrate, but I can't figure out how it
> > works. Can you give me a
Dec 22, 2:06 pm, Michael Bayer wrote:
> On Dec 21, 2009, at 9:05 PM, Nick Retallack wrote:
>
> > Say you've created some models in SQLAlchemy, and run create_all() to
> > get them into the database. Later on, you changed some of their
> > definitions, and you need to upd
Say you've created some models in SQLAlchemy, and run create_all() to
get them into the database. Later on, you changed some of their
definitions, and you need to update the database schema to correspond
to it. How would you do this? Can you get SQLAlchemy to output the
current SQL representatio
Hi Mike,
I'm using SQLite, and I'm tracking svn trunk (I'm at revision 6390).
Is the newer sqlite backend you mentioned somewhere else?
Thanks,
Nick
On Oct 6, 8:49 am, "Michael Bayer" wrote:
> Nick Murphy wrote:
>
> > Hi,
>
> > A class of mine ha
Is there a common workaround for this?
Thanks,
Nick
--~--~-~--~~~---~--~~
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 th
[func.blah.fishcakes(foo)])
Which produces, "select blah.fishcakes(foo) from dual;" allowing one
to select from a stored procedure.
I am wondering if there is a way to execute custom functions
programmatically in sqlalchemy.
Thanks
Nick
--~--~-~--~~~---~--~-
rn list of district years (possibly with number of rows in each
if possible)
2) For year X, return distinct list of days that there are rows for.
All this seems to hinge on having access to a sql function that
operators on the timestamp server-side.
Th
On Sep 30, 3:06 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Sep 30, 2008, at 4:59 AM, Nick Murdoch wrote:
>
>
>
>
>
>
>
> >> we have the "wrapper" thing, its the associationproxy. docs are
> >> here:
> >> http
lem.state
is not None], trans, delete=False)
File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.6-py2.4.egg/
sqlalchemy/orm/dependency.py", line 193, in process_dependencies
self._synchronize(state, child, None, True, uowcommit)
File "/usr/lib/python2.4/site-pac
NSERT INTO user_articles (user_id, session_id) VALUES
>>> (1, 1000);
Is this possible using SQLAlchemy? I'm aware I could simply perform
inserts and selects manually on the user_articles_table, but I'd quite
like SA to take care of that for me if at all possible.
I
> Logic that depends on any ordering from a non-ORDER BY result is a bug,
> but I don't know that the impact of presenting all users with a new,
> non-standard, non-native collection type and injecting some kind of
> __eq__ into mapped classes to satisfy a multiset contract is worth it
> for what
> if we had a totally explicit "collection class is required" approach,
> that would be something different (like, cant use "list" as a
> collection unless order_by is present). We might just say in any case
> that "order_by" is required with "list"but then that might be too
> steep a change
> mmh. between db's - maybe u're right. But the order will also change
> depending on current hash-values between 2 runs on otherwise same
> system... There's plenty of difficulties to get a repeatable flow for
> tests etc already.
That's exactly my point in fact -- unless order_by is specified,
, one cannot rely on a collection having a particular order.
I could see this as helpful in preventing bugs when switching between
databases (e.g. from MySQL to PostgreSQL) with different default
ordering behaviors.
Regards,
Nick
--~--~-~--~~~---~--~~
You received this
=True),
)
I'm completely stuck on the mappers, though. I've got the User <->
Interest one set up okay (I think) but SQLAlchemy refuses to generate
the SQL for User <-> User.
Thanks for any help,
Nick
--~--~-~--~~~---~--~~
You received this
.
Am I missing something?
Cheers,
Nick
--~--~-~--~~~---~--~~
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, sen
there a way I can do this without locking,
though, such as by adding my own UPDATE query to the transaction?
-Nick Johnson
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to
o create the user_products record. Ideally, I need
to update the relevant User object with the updated balance, too.
Can anyone provide me with a quick overview of how to do this?
Thanks,
Nick Johnson
--~--~-~--~~~---~--~~
You received this message because you are
27;2007-01-01' which seemed to work ok).
I'm new to SA so perhaps i should have been doing that all along
anyway.
Cheers
Nick
On 5 Jul, 15:29, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Jul 5, 2007, at 6:00 AM, Nick wrote:
>
> > class TestC(Entity):
> > with
take the following code with sqlite 3.4 on cygwin, and i get strftime
error on insert, any ideas?
Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
from elixir
31 matches
Mail list logo