fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added epub download desc
[wolnelektury.git]
/
apps
/
catalogue
/
migrations
/
0003_fix_book_count_on_shelves.py
diff --git
a/apps/catalogue/migrations/0003_fix_book_count_on_shelves.py
b/apps/catalogue/migrations/0003_fix_book_count_on_shelves.py
index
a161e27
..
8180311
100644
(file)
--- a/
apps/catalogue/migrations/0003_fix_book_count_on_shelves.py
+++ b/
apps/catalogue/migrations/0003_fix_book_count_on_shelves.py
@@
-23,11
+23,11
@@
class Migration(DataMigration):
'tagged_item': qn(orm.TagRelation._meta.db_table),
'tag_id': tag.pk,
}
'tagged_item': qn(orm.TagRelation._meta.db_table),
'tag_id': tag.pk,
}
-
+
cursor = connection.cursor()
cursor.execute(query)
book_count = (cursor.fetchone() or (0,))[0]
cursor = connection.cursor()
cursor.execute(query)
book_count = (cursor.fetchone() or (0,))[0]
-
+
tag.book_count = book_count
tag.save()
tag.book_count = book_count
tag.save()