jeffh/YACS — Issue #43: Crosslisting computation failure
Author: jeffh
Created: 2012-03-09 05:48:15+00:00
State: open
Labels: bug, rpi

Adding cross listing fails:

Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Users/jeff/Documents/projects/yacs/courses/management/commands/import_catalog_data.py", line 13, in handle
import_catalog(a=options.get('all', False))
File "/Users/jeff/Documents/projects/yacs/courses/bridge/rpi.py", line 310, in import_catalog
add_cross_listing()
File "/Users/jeff/Documents/projects/yacs/courses/bridge/rpi.py", line 326, in add_cross_listing
sc = SectionCrosslisting(semester=Semester.objects.get(id=course.semesters), ref=",".join(cross_list[i]))
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
return self.cursor.execute(sql, params)
File "/Users/jeff/.virtualenvs/yacs/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: more than one row returned by a subquery used as an expression