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 6959445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:16:22+00:00 2026-05-27T15:16:22+00:00

I’m using python-storm as orm. The many-to-many reference set is giving me headaches :(

  • 0

I’m using python-storm as orm. The many-to-many reference set is giving me headaches 🙁

These are the relevant objects:

class Author(object):
    __storm_table__ = "author"
    id = Int(primary=True)
    name = Unicode()
    institution_id = Int()
    institution = Reference(institution_id, Institution.id)

    def __init__(self, name):
        self.name = name


class Paper(object):
    __storm_table__ = "paper"
    id = Int(primary=True)
    name = Unicode()
    conference_id = Int()
    conference = Reference(conference_id, Conference.id)

    def __init__(self, name):
        self.name = name

class AuthorPapers(object):
    __storm_table__ = "authorpapers"
    __storm_primary__ = "author_id", "paper_id"
    author_id = Int()
    paper_id = Int()

The respective sqlite table look like this

store.execute("CREATE TABLE if not exists author (id INTEGER PRIMARY KEY, name VARCHAR, institution_id INTEGER, FOREIGN KEY (institution_id) REFERENCES institution(id))")

store.execute("CREATE TABLE if not exists paper (id INTEGER PRIMARY KEY, name VARCHAR, conference_id INTEGER, FOREIGN KEY (conference_id) REFERENCES conference(id))")

store.execute("CREATE TABLE if not exists authorpapers (author_id INTEGER, paper_id INTEGER, PRIMARY KEY (author_id, paper_id))")

Now say if a have two author the collaborated on a paper

a = Author(u"Steve Rogers")
b = Author(u"Captain America")

and a paper

p6 = Paper(u"Bunga Bunga")

So now I want to associate both author to the paper using

Author.papers = ReferenceSet(Author.id, AuthorPapers.author_id, Paper.id, AuthorPapers.paper_id)

and doing this

a.papers.add(p6)
b.papers.add(p6)

This is btw it says it is supposed to work in the storm tutorial…but I get

  File "/usr/lib64/python2.7/site-packages/storm/references.py", line 376, in add
    self._relation2.link(remote, link, True)
  File "/usr/lib64/python2.7/site-packages/storm/references.py", line 624, in link
    pairs = zip(self._get_local_columns(local.__class__),
  File "/usr/lib64/python2.7/site-packages/storm/references.py", line 870, in _get_local_columns
    for prop in self.local_key)
  File "/usr/lib64/python2.7/site-packages/storm/references.py", line 870, in <genexpr>
    for prop in self.local_key)
  File "/usr/lib64/python2.7/site-packages/storm/properties.py", line 53, in __get__
    return self._get_column(cls)
  File "/usr/lib64/python2.7/site-packages/storm/properties.py", line 97, in _get_column
    attr = self._detect_attr_name(cls)
  File "/usr/lib64/python2.7/site-packages/storm/properties.py", line 82, in _detect_attr_name
    raise RuntimeError("Property used in an unknown class")
RuntimeError: Property used in an unknown class

And I’m not really able to make sense of this right now.

  • 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-27T15:16:23+00:00Added an answer on May 27, 2026 at 3:16 pm

    I’m not really, familiar with storm, but looking at the documentation example, looks like is just an issue related to the order in which the arguments to ReferenceSet are passed. I tried to use this:

    Author.papers = ReferenceSet(Author.id, AuthorPapers.author_id, AuthorPapers.paper_id, Paper.id)
    

    instead of this:

    Author.papers = ReferenceSet(Author.id, AuthorPapers.author_id, Paper.id, AuthorPapers.paper_id)
    

    and no exception was raised.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Seemingly simple, but I cannot find anything relevant on the web. What is the
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am reading a book about Javascript and jQuery and using one of the

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.