Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(430)

Issue 3772048: sqlalchemy update with sqlite backend

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by kindly
Modified:
1 year ago
Reviewers:
Visibility:
Public.

Patch Set 1 #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -491 lines) Patch
M ckan/authz.py View 3 chunks +6 lines, -6 lines 1 comment Download
M ckan/controllers/package.py View 3 chunks +2 lines, -17 lines 2 comments Download
M ckan/lib/alphabet_paginate.py View 2 chunks +1 line, -7 lines 1 comment Download
M ckan/lib/create_test_data.py View 2 chunks +0 lines, -3 lines 0 comments Download
M ckan/lib/package_saver.py View 3 chunks +12 lines, -10 lines 1 comment Download
M ckan/model/__init__.py View 5 chunks +10 lines, -52 lines 3 comments Download
M ckan/model/domain_object.py View 1 chunk +1 line, -6 lines 3 comments Download
M ckan/model/group.py View 1 chunk +1 line, -1 line 0 comments Download
M ckan/model/harvesting.py View 2 chunks +1 line, -12 lines 0 comments Download
M ckan/model/meta.py View 1 chunk +3 lines, -1 line 0 comments Download
M ckan/model/package.py View 1 chunk +1 line, -1 line 0 comments Download
M ckan/model/tag.py View 1 chunk +1 line, -1 line 0 comments Download
M ckan/tests/__init__.py View 4 chunks +4 lines, -27 lines 0 comments Download
M ckan/tests/forms/test_authz.py View 3 chunks +3 lines, -4 lines 0 comments Download
M ckan/tests/forms/test_harvest_source.py View 1 chunk +1 line, -5 lines 0 comments Download
M ckan/tests/forms/test_package_gov.py View 2 chunks +2 lines, -2 lines 0 comments Download
M ckan/tests/functional/api/model/test_harvesting.py View 1 chunk +0 lines, -1 line 0 comments Download
M ckan/tests/functional/api/model/test_package.py View 2 chunks +1 line, -8 lines 0 comments Download
M ckan/tests/functional/api/test_form.py View 6 chunks +13 lines, -25 lines 0 comments Download
M ckan/tests/functional/api/test_form_package_gov.py View 3 chunks +0 lines, -4 lines 0 comments Download
M ckan/tests/functional/api/test_model.py View 8 chunks +18 lines, -14 lines 0 comments Download
M ckan/tests/functional/test_authorization_group.py View 2 chunks +1 line, -2 lines 0 comments Download
M ckan/tests/functional/test_authz.py View 6 chunks +5 lines, -6 lines 0 comments Download
M ckan/tests/functional/test_group.py View 3 chunks +3 lines, -4 lines 0 comments Download
M ckan/tests/functional/test_group_edit_authz.py View 2 chunks +2 lines, -2 lines 0 comments Download
M ckan/tests/functional/test_home.py View 2 chunks +0 lines, -13 lines 0 comments Download
M ckan/tests/functional/test_importer.py View 1 chunk +2 lines, -1 line 0 comments Download
M ckan/tests/functional/test_package.py View 23 chunks +27 lines, -80 lines 0 comments Download
M ckan/tests/functional/test_package_edit_authz.py View 2 chunks +2 lines, -2 lines 0 comments Download
M ckan/tests/functional/test_package_gov.py View 2 chunks +4 lines, -8 lines 0 comments Download
M ckan/tests/functional/test_revision.py View 1 chunk +2 lines, -2 lines 0 comments Download
M ckan/tests/functional/test_user.py View 1 chunk +1 line, -1 line 0 comments Download
M ckan/tests/lib/test_alphabet_pagination.py View 6 chunks +2 lines, -6 lines 0 comments Download
M ckan/tests/lib/test_package_search.py View 3 chunks +3 lines, -5 lines 0 comments Download
M ckan/tests/lib/test_package_search_synchronous_update.py View 2 chunks +0 lines, -4 lines 0 comments Download
M ckan/tests/lib/test_resource_search.py View 2 chunks +0 lines, -4 lines 0 comments Download
M ckan/tests/lib/test_search_index.py View 2 chunks +0 lines, -3 lines 0 comments Download
M ckan/tests/misc/test_package_saver.py View 1 chunk +1 line, -5 lines 0 comments Download
M ckan/tests/misc/test_spreadsheet_importer.py View 4 chunks +3 lines, -7 lines 0 comments Download
M ckan/tests/misc/test_stats.py View 5 chunks +2 lines, -12 lines 0 comments Download
M ckan/tests/models/test_authz.py View 7 chunks +6 lines, -16 lines 0 comments Download
M ckan/tests/models/test_changeset.py View 6 chunks +6 lines, -8 lines 0 comments Download
M ckan/tests/models/test_group.py View 2 chunks +2 lines, -4 lines 0 comments Download
M ckan/tests/models/test_harvesting.py View 5 chunks +4 lines, -10 lines 0 comments Download
M ckan/tests/models/test_misc.py View 1 chunk +2 lines, -1 line 0 comments Download
M ckan/tests/models/test_package.py View 10 chunks +3 lines, -20 lines 0 comments Download
M ckan/tests/models/test_resource.py View 7 chunks +9 lines, -20 lines 1 comment Download
M ckan/tests/models/test_user.py View 1 chunk +0 lines, -9 lines 0 comments Download
M ckan/tests/test_authz.py View 9 chunks +7 lines, -10 lines 0 comments Download
M ckan/tests/test_wsgi_ckanclient.py View 2 chunks +1 line, -4 lines 0 comments Download
M pip-requirements.txt View 1 chunk +1 line, -1 line 0 comments Download
M setup.py View 1 chunk +1 line, -1 line 0 comments Download
R sqlalchemy.patch View 1 chunk +0 lines, -12 lines 0 comments Download
M test.ini View 1 chunk +78 lines, -1 line 0 comments Download

Messages

Total messages: 2
kindly
http://codereview.appspot.com/3772048/diff/1/ckan/authz.py File ckan/authz.py (left): http://codereview.appspot.com/3772048/diff/1/ckan/authz.py#oldcode184 ckan/authz.py:184: Not so sure it was wrong before. Issue is ...
13 years, 11 months ago (2010-12-29 23:16:41 UTC) #1
kindly
13 years, 11 months ago (2010-12-30 02:44:27 UTC) #2
http://codereview.appspot.com/3772048/diff/1/ckan/controllers/package.py
File ckan/controllers/package.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/controllers/package.py#oldc...
ckan/controllers/package.py:296: c.pkg = pkg = model.Package.get(id)
Solved the error below by this
model.Session().autoflush = False

http://codereview.appspot.com/3772048/diff/1/ckan/controllers/package.py#oldc...
ckan/controllers/package.py:353: c.pkg.groups
solved by adding 

Session().autoflush = False

http://codereview.appspot.com/3772048/diff/1/ckan/lib/alphabet_paginate.py
File ckan/lib/alphabet_paginate.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/lib/alphabet_paginate.py#ol...
ckan/lib/alphabet_paginate.py:78: self.alpha_attribute)
look here as to how to do this properly in 0.6.  In 0.5 you can't.

http://www.sqlalchemy.org/docs/orm/query.html#sqlalchemy.orm.query.Query.colu...

http://codereview.appspot.com/3772048/diff/1/ckan/lib/package_saver.py
File ckan/lib/package_saver.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/lib/package_saver.py#oldcod...
ckan/lib/package_saver.py:107: fs.sync()
Did not need to change any of the above just did

model.Session().autoflush = False

BEFORE fs.sync()

http://codereview.appspot.com/3772048/diff/1/ckan/model/__init__.py
File ckan/model/__init__.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/model/__init__.py#oldcode100
ckan/model/__init__.py:100: connection.execute('drop table "%s"' % table.name)
The point of the patch was to do deletes and not drops. So it should change to.

connection.execute('delete from "%s"' % table.name)

http://codereview.appspot.com/3772048/diff/1/ckan/model/__init__.py#oldcode102
ckan/model/__init__.py:102: #self.add_initial_data()
The self.add_initial_data() should be reinstated.

http://codereview.appspot.com/3772048/diff/1/ckan/model/__init__.py#oldcode134
ckan/model/__init__.py:134: raise
Not working yet for me.

http://codereview.appspot.com/3772048/diff/1/ckan/model/domain_object.py
File ckan/model/domain_object.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/model/domain_object.py#oldc...
ckan/model/domain_object.py:38: from sqlalchemy.orm import class_mapper
importing in time critical code is not great.

http://codereview.appspot.com/3772048/diff/1/ckan/model/domain_object.py#oldc...
ckan/model/domain_object.py:41: if Session.connection().engine.has_table(table):
Inspecting the database for what tables there are in time critical code not
good.

http://codereview.appspot.com/3772048/diff/1/ckan/model/domain_object.py
File ckan/model/domain_object.py (right):

http://codereview.appspot.com/3772048/diff/1/ckan/model/domain_object.py#newc...
ckan/model/domain_object.py:38: obj =
Session.query(self).autoflush(autoflush).filter_by(name=name).first()
This is correct as far as I can see.  I have found no issues with it.

http://codereview.appspot.com/3772048/diff/1/ckan/tests/models/test_resource.py
File ckan/tests/models/test_resource.py (left):

http://codereview.appspot.com/3772048/diff/1/ckan/tests/models/test_resource....
ckan/tests/models/test_resource.py:33: if pkg:
I sorted this out by doing a 
model.Session().autoflush = False.
You will not need to create a revision this way
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b