Commit graph

25 commits

Author SHA1 Message Date
rr-
ad842ee8a5 server: refactor + add type hinting
- Added type hinting (for now, 3.5-compatible)
- Split `db` namespace into `db` module and `model` namespace
- Changed elastic search to be created lazily for each operation
- Changed to class based approach in entity serialization to allow
  stronger typing
- Removed `required` argument from `context.get_*` family of functions;
  now it's implied if `default` argument is omitted
- Changed `unalias_dict` implementation to use less magic inputs
2017-02-05 16:34:45 +01:00
rr-
bb369efa99 server/general: disable autoflush 2016-08-26 14:41:05 +02:00
rr-
9aea55e3d1 server/general: embrace most of PEP8
Ignored only the rules about continuing / hanging indentation.

Also, added __init__.py to tests so that pylint discovers them. (I don't
buy pytest's BS about installing your package.)
2016-08-14 16:44:03 +02:00
rr-
af62f8c45a server/general: ditch falcon for in-house WSGI app
For quite some time, I hated Falcon's class maps approach that caused
more chaos than good for Szurubooru. I've taken a look at the other
frameworks (hug, flask, etc) again, but they all looked too
bloated/over-engineered. I decided to just talk to WSGI myself.

Regex-based routing may not be the fastest in the world, but I'm fine
with response time of 10 ms for cached /posts.
2016-08-14 16:43:35 +02:00
rr-
8d04df38fd server/general: add entity versions 2016-08-07 09:55:51 +02:00
rr-
5e47c5c0c6 server/users: use HTTPS for Gravatar 2016-07-30 13:43:15 +02:00
rr-
13ca94d4da server/users: fix avatar issues when renaming user 2016-06-17 21:25:28 +02:00
rr-
caecaee785 server/users: offer more stats in user entity 2016-06-03 21:46:25 +02:00
rr-
8d1e23aa63 server/general: flatten responses 2016-05-30 22:54:33 +02:00
rr-
14a20e55f8 server/tests: fix leftover rank strings 2016-05-10 12:15:33 +02:00
rr-
906eddc61f server/users: change avatars to PNG 2016-05-08 18:04:06 +02:00
rr-
2bd02f4921 server/users: fix detecting duplicate user names 2016-05-08 18:04:05 +02:00
rr-
0214341473 server/users: prohibit using special ranks
Anonymous is self explanatory.
Nobody is used solely to mark certain operation as unavailable even to
administrators (<- nobody is higher than administrator).
2016-05-08 18:04:05 +02:00
rr-
198cb0af3e server/users: hardcode available ranks 2016-05-08 16:59:25 +02:00
rr-
8fb536c8f0 server/general: move not found errors to func 2016-04-24 14:34:01 +02:00
rr-
a926838b90 server/general: rename 'misc' to 'util' 2016-04-20 11:59:46 +02:00
rr-
57b18c6461 server/general: rename 'util' to 'func' 2016-04-20 11:58:17 +02:00
rr-
2e57a0746f server/general: consistently use db.session 2016-04-19 18:10:22 +02:00
rr-
58838f8bd9 server/tests: refactor tests 2016-04-19 13:01:50 +02:00
rr-
83784c5e76 server/api: improve input sanitization, fix docs 2016-04-19 11:55:31 +02:00
rr-
37a86816af server/tags: add tag deleting 2016-04-16 17:03:28 +02:00
rr-
e4239a199c server/api: refactor + remove ID from user JSON 2016-04-16 15:49:21 +02:00
rr-
9e873145a4 server/tags: add tag creating 2016-04-16 09:19:55 +02:00
rr-
3d4ceb13b8 server/api: move all io mgmt to context
where input/output includes files, JSON metadata and GET parameters.
Additionally, formalize context with a new class, Context.
2016-04-15 23:26:38 +02:00
rr-
07ea920def server/tests: switch to pytest 2016-04-15 18:00:06 +02:00