OK, I made 
https://bitbucket.org/zzzeek/sqlalchemy/issue/3194/misleading-warning-when-non-column
 and that is fixed with a small patch.


On Sep 11, 2014, at 9:10 AM, Michael Bayer <[email protected]> wrote:

> you can filter the warnings as "ALWAYS" for now, and the warning here should 
> probably not come out if you've in fact given remote_side so please raise an 
> issue for that.
> 
> 
> 
> On Sep 11, 2014, at 2:38 AM, Victor Reichert <[email protected]> wrote:
> 
>> Hi,
>> 
>> I'm using flask-sqlahcmey and I have a self referential relationship like 
>> this:
>> 
>> class FileData(db.Model):
>>     id = db.Column(db.Integer, primary_key = True)
>>     primary_file_data_id = db.Column(db.Integer, ForeignKey('file_data.id'))
>>     is_edited_file = db.Column(db.Boolean, default = False, nullable = False)
>>     edited_datas = db.relationship("FileData", remote_side = 
>> [primary_file_data_id], primaryjoin="and_( FileData.id == 
>> FileData.primary_file_data_id , FileData.is_edited_file == True )")
>> 
>> The intent of the edited_datas is to find the the records where the 
>> primary_file_data_id equals the current FileData instance id and where the 
>> is_edited_file flag is true.  The relationship seems to be functioning 
>> correctly, but I'm getting a warning from sqlalchemy:
>> 
>> /Users/Victor/Documents/Python/proj/pgp_venv/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py:2085:
>>  SAWarning: Non-simple column elements in primary join condition for 
>> property FileData.edited_files - consider using remote() annotations to mark 
>> the remote side.
>> 
>> self._warn_non_column_elements()
>> 
>> I think I am using the remote_side keyword properly.  Should I be using 
>> something else to mark the remote side?
>> 
>> If I'm doing everything correclty, is there a way to suppress this (and only 
>> this) message?  I would rather get this message than miss other warning SA 
>> might give me.
>> 
>> Thank you for your help,
>> 
>> ~Victor
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to