Hi,
We have a relationship that looks something like this:
User 1 - * Posts
Posts can have various states, let's say 'DRAFT', 'LIVE', 'DELETED'.
Sometimes, we want to get all of the posts in existence for a user by doing:
user.all_posts
Sometimes, we just want to get posts that are not
Is there an obvious way to set up an association proxy so that it only
returns distinct objects?
For example, if I have:
Post - Tag - Tag_Category
and would like to access Post.Tag_Categories so that it contains each
category only once.
Any tips appreciated, sure I am missing something obvious
:08 AM, Benjamin Sims wrote:
Is there an obvious way to set up an association proxy so that it only
returns distinct objects?
For example, if I have:
Post - Tag - Tag_Category
and would like to access Post.Tag_Categories so that it contains each
category only once.
Any tips
this I have to make sure
that all DB calls do a session.close() or session.rollback() when finished?
Any thoughts on how to track which call is leaving the connection open?
On 31 October 2011 17:16, Michael Bayer mike...@zzzcomputing.com wrote:
On Oct 31, 2011, at 12:56 PM, Benjamin Sims wrote
Hi all,
I'm seeing this error intermittently in my application since switching to
MySQL - it occurs on several different pages and I can't track down why:
StatementError: Can't reconnect until invalid transaction is rolled back
(original cause: InvalidRequestError: Can't reconnect until invalid
the errors
On 31 October 2011 14:38, Michael Bayer mike...@zzzcomputing.com wrote:
On Oct 31, 2011, at 8:45 AM, Benjamin Sims wrote:
Hi all,
I'm seeing this error intermittently in my application since switching to
MySQL - it occurs on several different pages and I can't track down why
I've recently moved from SQLite to MySQL as the underlying database for my
application. The move is causing me various problems, principally around
Unicode. I *think* they were not occurring when SQLite was there, so I
thought I would ask if anybody on the list has had similar problems.
My
Bayer mike...@zzzcomputing.com wrote:
Can you attach a traceback for that?
Sent from my iPhone
On Sep 29, 2011, at 7:45 AM, Benjamin Sims benjamins...@gmail.com wrote:
I've recently moved from SQLite to MySQL as the underlying database for my
application. The move is causing me various
://farmdev.com/talks/unicode/
because it will help you understand what the dreaded error really
means.
On Sep 29, 9:06 am, Benjamin Sims benjamins...@gmail.com wrote:
File scraper.py, line 77, in run
session.commit()
File
/home/benjamin/test/test1/lib/python2.6/site-packages/SQLAlchemy
way - the side that does *not* have the foreign key on it).Since
associations is on the backref side of the declaration here, use the
backref() function and put cascade='all, delete-orphan' on that side.
On Aug 31, 2011, at 7:04 AM, Benjamin Sims wrote:
Hi,
I'm still having troubles
Hi,
I'm still having troubles correctly figuring my various many-to-many
relations. Originally, this was a 'standard' many-to-many; that is, a
secondary table was specified.
However, I now need to add further information to the relation and am
converting into an AssociationObject. My problem is
Thanks for the help with my query the other day - as ever response was swift
and bang on.
I'm now trying to set up another m:n relationship in ORM correctly.
Pseudocode:
parentA.children.append(child1)
parentA.children.append(child2)
parentB.children.append(child2)
session.delete(parentA)
At
I have a many-to-many relationship with attributes:
Parent - AssocObject - Child
I'm trying to set it up so that when an AssocObject is removed from parent,
that instance of AssocObject and the Child are also deleted. So in my view I
do:
del parent.associatedobjects
I have changed the model so
Thanks so much for the help. For the record, setting an __init__ argument on
the association argument did the trick.
Ben
On 2 Aug 2011, at 01:47, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 1, 2011, at 8:34 PM, somewhatofftheway wrote:
Hi,
I'm trying to convert a
14 matches
Mail list logo