#151 sqlmeta's addJoin ignores joinMethodName

closed-duplicate
nobody
General (125)
5
2006-02-06
2006-01-26
Anonymous
No

<bug info>
Discovered by Ramon Bastiaans <bastiaans@sara.nl>:

In SQLObject 0.7 with Python 2.3 on Debian Linux in
conjuction with Postgres SQL.
</bug info>

1. Started with a dbase .py with something like this;

---
class <existing_table>( SQLObject ):

.. bla ..
.. bla ..
.. bla ..
---
2. then I added:
---
class <new_relation>( SQLObject ):

.. bla ..
.. bla ..
---
3. Then I did:

python
from my_dbase import existing_table, new_relation
existing_table.sqlmeta.addJoin( RelatedJoin(
'new_relation', joinMethodName='lookatmynewclass' ) )

4. Then I changed my initial setup to:
---
class <existing_table>( SQLObject ):

.. bla ..
.. bla ..
.. bla ..
lookatmynewclass = RelatedJoin( 'new_relation' )
---

5. Now when I do:
---
my_object = existing_table.selectBy(
mywhatever='something' )
print dir( my_object )
---

There is a attribute "new_relations" (new class + 's')
instead of (what I expected) "lookatmynewclass".

6. I have worked around this by changing my class
definition to:
---
class <existing_table>( SQLObject ):

.. bla ..
.. bla ..
.. bla ..
lookatmynewclass = RelatedJoin( 'new_relation',
joinMethodName='lookatmynewclass' )
---

Discussion

  • Oleg Broytman

    Oleg Broytman - 2006-02-06
    • status: open --> closed-duplicate
     
  • Oleg Broytman

    Oleg Broytman - 2006-02-06

    Logged In: YES
    user_id=4799

    This is a duplicate of the bug 1415402.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks