Commit Graph

123 Commits

Author SHA1 Message Date
j 774450d263 missing imports and typos 2024-04-05 21:20:45 +01:00
j 4fb8879ba0 migrate bigint ids 2023-07-27 23:45:37 +02:00
j 543d01696e dont use lambda in default 2023-07-27 23:30:19 +02:00
j a035d37229 add apps.py to all apps 2023-07-27 19:27:00 +02:00
j 512f07400d don't fail if hidden is not set 2023-07-07 11:49:56 +05:30
j 034b448846 add ability to hide list/edits/collections from personal section but keep around in case they are shared or linked from elsewhere, but cluster the personal section 2023-07-07 11:46:09 +05:30
j e237d08120 fix sort by value of smart edits 2021-11-24 14:23:50 +01:00
j 8a16c7e37f escape & too 2021-09-15 14:05:11 +02:00
j 098d953bbc filter more invalid clips 2021-08-08 19:47:38 +02:00
j 0a7b6c0452 include outer cuts (before, after) 2021-08-06 12:05:19 +02:00
j 548a73f121 python3 only: remove six.moves imports 2020-05-29 12:17:18 +02:00
j 844382b1e8 drop python2 support, upgrade to django 3 2020-05-29 00:25:16 +02:00
j 6706b93614 minor performance improvements 2019-08-01 17:00:02 +02:00
j c039279984 revert 2018-11-15 11:17:48 +00:00
j 72bb3ba6c1 item should only be loaded if item is joined, disable for now 2018-11-15 11:17:29 +00:00
j 4512b010c6 undo 2018-11-15 10:28:51 +00:00
j 687738ff46 make sure settings are dicts 2018-11-15 10:28:30 +00:00
j 503ae10e89 don't pass user as keys 2018-11-14 16:09:24 +00:00
j bb563c1d82 dereference annotation 2018-11-13 12:06:24 +00:00
j f818f962bc return empty query 2018-08-09 10:23:53 +01:00
j cc56858377 import Group from user.models 2018-07-29 20:28:46 +00:00
j 6296be870b use get_user_model 2018-07-29 21:12:56 +01:00
j bd0732b8d5 rename item.json -> item.cache 2018-07-09 15:22:12 +02:00
j 1bac062a50 use postgres json field 2018-07-09 15:22:12 +02:00
j dbf740e55e use .editorconfig 2018-06-19 08:33:26 +02:00
j 859a820c90 add ui for lists/edits/collections groups 2018-03-06 15:11:05 +05:30
j 6c6b60ffaf lower auth deps 2017-12-31 14:21:18 +01:00
j 85c5fafe0d add groups to collections, edits and lists, towards #3063 2017-12-31 14:06:27 +01:00
j 6d867b1a7d return 404 not 403 for private edits, fixes #3024 2017-05-29 12:14:50 +02:00
j be34383f8c expose per clip volume in edits 2017-04-15 13:45:31 +02:00
j f0a4aba751 use python_2_unicode_compatible 2017-03-03 08:56:35 +01:00
j 1468ddbecb towards supporting python 2 and 3
- use absolute_imports
- make use of six.moves
- use exec instead of execfile
- use list(dict) instead if dict.keys()
2016-08-25 18:34:36 +02:00
j 97a46dceb0 fix sort of static edits 2016-08-23 13:24:27 +02:00
j 9685c7e4a5 fix streams for static edits 2016-08-23 13:24:22 +02:00
j e9863c238e always use get_operator, avoid case-insensitive match if possible 2016-06-30 11:28:09 +02:00
j 5e149a5cb8 add space and other flake8 cleanups 2016-05-28 11:26:46 +02:00
j 0d5c968026 space 2016-02-20 10:41:23 +00:00
j 051a3578b4 inline django 1.9 version of ox.django 2016-02-20 10:41:23 +00:00
j 4219246909 db migration 2016-02-20 15:15:01 +05:30
j 1cc795995d user.get_profile()->user.profile 2016-02-19 22:06:11 +05:30
j 5d63ad1760 default/upload_to=lambda breaks migrations, use functions 2016-02-19 21:59:26 +05:30
j e22cc432b3 use transaction.atomic 2016-02-19 21:55:09 +05:30
j e738503380 remove old migrations 2016-02-19 15:17:18 +00:00
j 35bdfba77c fix default values 2016-02-19 19:01:38 +05:30
j d241b90b63 check data is a dict 2016-02-19 18:46:53 +05:30
j 2e3b61d163 dont fail if files are already gone 2015-10-04 18:17:34 +01:00
j be1589569e fix clip index for newly added clips 2015-10-04 11:04:46 +01:00
Will Thompson eebb0b5681 Combine {Item,Clip,edit.Clip}.get_layers()
This has several benefits:

    • Clip.get_layers() (used by smart edits) and Item.get_layers() pick up
    the select_related('user') optimization added for static edits in
    r5007.

    • Static edits and items pick up the optimization from r4941 to select
    annotations once, not once per layer.

Fetching an item with ~1000 annotations took ~1s without this patch,
~0.34s with this patch. Another item with ~6000 annotations took ~11.6s
before, ~8.6s after.

Because this block is moved out to the top:

if user and user.is_anonymous():
user = None

then, for anonymous users,

"editable": false,

is no longer included in the annotations. The old behaviour ended up
including this key in all layers listed before the first private layer
in the config, and leaving it out from later ones. So this new behaviour
is more consistent.
2015-09-14 14:06:43 +02:00
Will Thompson 3da3bd37fd addClips: return error if item/in/out missing, not 500 2015-08-07 13:37:56 +02:00
Will Thompson f3fdded07d Edit.json: preload annotation users
The expensive part of fetching an edit is JSONifying the clips'
annotations. Profiling showed that the main cost was Annotation.json(),
and within that:

File: /srv/pandora/pandora/annotation/models.py
Function: json at line 216

Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
216                                               def json(self, layer=False, keys=None, user=None):
217       632          827      1.3      0.1          j = {
218       632      1048170   1658.5     89.6              'user': self.user.username,
219                                                   }

Obviously this join just moves some of the cost further out, but it
brings my micro-benchmark down from 1.3s to 0.3s.
2015-08-02 16:02:47 +02:00