\[localhost\] local: ./manage.py syncdb
Error: One or more models did not validate:
lrs.verb: "verb_id": CharField cannot have a "max_length" greater than 255 when using "unique=True".
Changing the "MAX_URL_LENGTH = 2083" to "MAX_URL_LENGTH = 255" in ADL_LRS/oauth_provider/consts.py works, but not sure if it actually require more than 255 since this MAX_URL_LENGTH is used by lot of models in model.py, if 2083 is actually required you have to change all feilds in mysql database which has varchar(255) to varchar(1000) by storage engine to MyISAM, after they are created succesfuly by setup.py with value 255.
After starting the LSR app and generating some statements into LRS using LMS (Sakai). When tried to view the statements below error occurs.
2014-02-11 15:29:31,793 [ERROR] django.request: Internal Server Error: /xAPI/me/statements/Traceback (most recent call last):
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view return view_func(request, *args, **kwargs)
File "/home/adllrs/lrs/ADL_LRS/lrs/views.py", line 273, in my_statements
stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=(idlist)).order_by('-timestamp')]
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 875, in _fill_cache
self._result_cache.append(self._iter.next())
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator for row in compiler.results_iter():
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI):
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 114, in execute return self.cursor.execute(query, args)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute self.errorhandler(self, exc, value)
File "/home/adllrs/lrs/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue
DatabaseError: (1235, "This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'")
In ADL_LRS/lrs/views.py ,forcing execution of the first query "idlist" using function list() fixed this.
Below is the diff for the fix .
@@ -270,7 +270,7 @@ def my_statements(request):
idlist = page.object_list
if idlist.count() > 0:
- stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=(idlist)).order_by('-timestamp')]
+ stmt_objs = [stmt for stmt in models.Statement.objects.filter(id__in=list(idlist)).order_by('-timestamp')]
else:
stmt_objs = []