Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:14:45+00:00 2026-05-27T06:14:45+00:00

My google foo has been coming up short on this, so I throw this

  • 0

My google foo has been coming up short on this, so I throw this to the geniuses here.

I’m writing some beer recipe creation software and I’ve got a class in SQLObject and I’d like to have a RelatedJoin back to itself. But it’s not working.

If it matters I’m using SQLite3.

Here’s the table:

class Hop(SQLObject):
    BITTERING = 0 
    AROMA = 1
    BOTH = 2
    LEAF = 0
    PELLET = 1
    PLUG = 2
    hop_types = ['Bittering', 'Aroma', 'Both',]
    hop_forms = ['Leaf', 'Pellet', 'Plug',]

    hop_type = IntCol(default=BITTERING)
    hop_form = IntCol(default=LEAF)
    alpha = PercentCol(default=0.0)
    beta = PercentCol(default=0.0)
    stability = PercentCol(default=0.0)
    origin = UnicodeCol(default=None)
    name = UnicodeCol(length=64, default=None)
    description = UnicodeCol(default=None)
    substitutes = RelatedJoin('Hop')

And here’s the error:

>>> hop = Hop(name='Cascade', hop_form=LEAF, alpha=5.5, beta=4.8, stability=98.0, origin='USA', description='Tasty!')
>>> hop.id
2
>>> substitute_hop = Hop.get(1)
>>> hop.addHop(subtitute_hop)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <lambda>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/joins.py", line 230, in add
    getID(other))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/dbconnection.py", line 574, in _SO_intermediateInsert
    self.sqlrepr(secondValue)))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/dbconnection.py", line 349, in query
    return self._runWithConnection(self._query, s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/dbconnection.py", line 262, in _runWithConnection
    val = meth(conn, *args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/dbconnection.py", line 346, in _query
    self._executeRetry(conn, conn.cursor(), s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/SQLObject-0.13.0-py2.7.egg/sqlobject/sqlite/sqliteconnection.py", line 187, in _executeRetry
    raise OperationalError(ErrorMessage(e))
sqlobject.dberrors.OperationalError: no such table: hop_hop

Here is the function that generates the database

def connect_db(config):
    init = False
    if not os.path.exists(config['DB_NAME']):
        init = True
    connection = connectionForURI("%s%s%s" % (config['DB_DRIVER'],
                                              config['DB_PROTOCOL'],
                                              config['DB_NAME']))
    sqlhub.processConnection = connection
    if init:
        init_db(config)

def init_db(config):
    tables = [Entry, Users, Tag, Image, Hop, Grain, Extract, HoppedExtract,
              Yeast, Water, Misc, Mineral, Fining, Flavor, Spice, Herb,
              BJCPStyle, BJCPCategory,  MashTun, BoilKettle, EquipmentSet,
              MashProfile, MashStep, MashStepOrder, Recipe, RecipeIngredient,
              Inventory]
    for table in tables:
        try:
            table.createTable()
        except OperationalError:
            pass
    admin = Users(email=config['ADMIN_USERNAME'])
    admin.set_pass(config['PASSWORD_SALT'], config['ADMIN_PASSWORD'])
    admin.admin = True
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:14:46+00:00Added an answer on May 27, 2026 at 6:14 am

    Solved it. You have explicitly name the columns and the table for the join since it’s only “one-sided”:

    class Hop(SQLObject):
        BITTERING = 0 
        AROMA = 1
        BOTH = 2
        LEAF = 0
        PELLET = 1
        PLUG = 2
        hop_types = ['Bittering', 'Aroma', 'Both',]
        hop_forms = ['Leaf', 'Pellet', 'Plug',]
    
        hop_type = IntCol(default=BITTERING)
        hop_form = IntCol(default=LEAF)
        alpha = PercentCol(default=0.0)
        beta = PercentCol(default=0.0)
        stability = PercentCol(default=0.0)
        origin = UnicodeCol(default=None)
        name = UnicodeCol(length=64, default=None)
        description = UnicodeCol(default=None)
        substitutes = RelatedJoin('Hop',
                                  joinColumn='master_hop',
                                  otherColumn='substitute_hop',
                                  addRemoveName="Substitute",
                                  intermediateTable="substitute_hops",
                                  createRelatedTable=True)
        versions = Versioning()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been fiddling with this for over twenty minutes and my Google-foo is failing
Google's not coming to my rescue, here, and I just know this is the
I'm sure this is an easy problem, but my google / help foo has
I've been searching Google and no one has come across this problem yet. I
Google is failing me on this one. Let's say I have some ECMA script
I've been working with Google App Engine and I'm running into some slow performance
Here is what I'd like to achieve http://foo.somedomain.com gets handled by http://myapp.appspot.com/foo (google appengine
So the jQuery plugin site is down and my google foo has let me
Sorry If something like this has already been asked, but I can't find exactly
I have searched but apparently my google foo is weak. What I need is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.