Commit Graph

107 Commits

Author SHA1 Message Date
collerek 8a75379b44 update documentation, optimize for memory saving, update docs for select_related, fields and exclude_fields, bump version 2020-11-26 09:15:13 +01:00
collerek ba360974de some refactors and cleanup 2020-11-26 07:26:16 +01:00
collerek f8dbb76965 add aliases to test prefetch_related 2020-11-26 06:33:24 +01:00
collerek 6893aa5095 Merge branch 'master' of https://github.com/collerek/ormar into prefetch_related 2020-11-25 21:22:01 +01:00
collerek d6f995d349 refactor and cleanup for further optimization 2020-11-25 20:52:01 +01:00
collerek f2fe41d38a cleaner version but still dirty 2020-11-25 13:28:51 +01:00
EspenAlbert 6f9b32b575 refactor to a more sensible test.
reduce cyclomatic complexity of if clause
2020-11-24 18:52:51 +00:00
EspenAlbert cf3ec2e2a5 Refactor tests to cover all lines. 2020-11-24 09:09:54 +00:00
EspenAlbert a668b20f1a Add test for an Album with tracks. 2020-11-24 08:56:57 +00:00
EspenAlbert 3eccd05ece support updating models on the many side of the one-to-many relations. 2020-11-24 08:49:29 +00:00
collerek 585bba3ad3 dirty many to many pass first test 2020-11-23 17:03:31 +01:00
collerek b696156f56 dirty prefetch_related working for FK and reverse FK 2020-11-23 16:05:05 +01:00
collerek 2385f95a9f fix saving string pk and add db refresh for server_defaults in save() also, bump version 2020-11-20 11:03:57 +01:00
collerek 5e1f8ddecd bump ver, some cleanup 2020-11-16 13:14:47 +01:00
collerek 1168159a70 bump ver, some cleanup 2020-11-16 13:10:03 +01:00
collerek d478ea6e15 add follow=True for save_related, update docs 2020-11-15 10:33:03 +01:00
collerek 0f36944fe1 add safe fails for adding and removing not saved models to many to many rel, add tests for save_related 2020-11-14 14:47:33 +01:00
collerek cd33f6a96b introduce save_related method that traverses the related objects and upserts them if they are not saved 2020-11-14 14:29:54 +01:00
collerek 58a3855697 add saved property to avoid private prop access 2020-11-14 13:57:04 +01:00
collerek e805ff16b2 introduce upsert method on model, add tests to see if save status properly changing on nested models 2020-11-14 13:53:32 +01:00
collerek b0cf916531 add saving status and basic test for this 2020-11-13 13:39:19 +01:00
collerek 381995250d update docs, fix for ellipsis for whole model, some more tests 2020-11-12 11:08:27 +01:00
collerek e743286008 some cleanup of unused relations code, introduced caching of related_names and props on model, set profiling 2020-11-12 08:11:40 +01:00
collerek 1242e5d600 allow passing a dict and set to fields and exclude_fields, store it as dict 2020-11-11 19:00:03 +01:00
collerek a797373983 add nested for all aliases as postgres serves nulls first when order by desc 2020-11-11 10:35:16 +01:00
collerek 9350b929aa black, add additional tests with combined fields and exclude_fields, add aliases for column names to tests with fields and exclude_fields 2020-11-11 10:10:30 +01:00
collerek eafc6862f4 add exclude_fields queryset method 2020-11-10 16:54:24 +01:00
collerek 22d594bcbd include properties as fields in dict and json of models 2020-11-10 11:25:34 +01:00
collerek d06a88fb6f add additional test for loading the related model after returning fastapi pk dummy model 2020-11-09 16:03:22 +01:00
collerek 3b3f0445f4 allow in fastapi to return related models with only pk populated 2020-11-09 15:40:26 +01:00
collerek 76a541d0e4 change test values to make it clear what is the order, not case sensitive - different on diff backends 2020-11-09 14:04:09 +01:00
collerek ca38f7853e working order by, refactor models merging, refactors ordering into dict 2020-11-09 12:45:32 +01:00
collerek 9f4bde595f working for simple models, not including related models yet 2020-11-08 09:44:30 +01:00
collerek cce59acd99 update docs, cleaning 2020-11-01 11:41:18 +01:00
collerek 358b5c2e52 restore typing in tests and docs, remove unused metaclass code 2020-11-01 10:11:25 +01:00
collerek 79cf225ddc fix scale and precision in decimal 2020-10-31 18:42:13 +01:00
collerek 3c10892db7 liniting, black, mypy fixes 2020-10-31 18:22:15 +01:00
collerek 7d5e291a19 switch to equals in most of the code, fix dependencies, clean tests, make all not relation fields work with type hints 2020-10-31 18:11:48 +01:00
collerek 8fba94efa1 allow change to build in type hints 2020-10-31 15:43:34 +01:00
collerek 320588a3c1 some typos 2020-10-31 09:23:24 +01:00
collerek 7184f8df9a add nocover 2020-10-28 15:52:13 +01:00
collerek 56c527485d add test exclusion for postgres as it uses transaction timestamp 2020-10-28 15:48:33 +01:00
collerek f96845674b connect db <facepalm> 2020-10-28 15:38:15 +01:00
collerek 29d04887b1 fix server_default not setting value in defaults, pop server_default fields if set to None, add tests, update docs 2020-10-28 15:34:40 +01:00
collerek 82e3eb94ae modify schema to show many to many as list of nested models, check openapi generation in tests 2020-10-27 17:55:41 +01:00
collerek d3091c404f fix many_to_many lazy registration in fastapi cloned models, fixed ForeignKey not treated as subclasses of BaseModels in json schema 2020-10-27 13:49:07 +01:00
collerek 36300f9056 refactor translating of aliases from queryset to modelproxy 2020-10-26 14:50:04 +01:00
collerek d1299b058d add more test with alternative column names 2020-10-22 12:58:03 +02:00
collerek 394de2d11c fix bug in bulk_update, update documentation, update readme, bump version 2020-10-22 12:48:40 +02:00
collerek dbca4367e8 fix qryset fields, model update, model delete, model load, qryset update, qruset filter, qryset bulk_load, qryset bulk_update 2020-10-21 12:14:14 +02:00