Anders Kaseorg
0628c3cac8
migrations: Import BaseDatabaseSchemaEditor from its canonical module.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2023-03-05 14:46:28 -08:00
Zixuan James Li
d5517932cd
typing: Use BaseDatabaseSchemaEditor in place of DatabaseSchemaEditor.
...
This is a part of #18777 .
Signed-off-by: Zixuan James Li <359101898@qq.com >
2022-05-30 14:18:53 -07:00
Anders Kaseorg
342834ee9c
python: Simplify stdio flushing using print(…, flush=True).
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2021-06-09 14:05:31 -07:00
Anders Kaseorg
6e4c3e41dc
python: Normalize quotes with Black.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2021-02-12 13:11:19 -08:00
Anders Kaseorg
11741543da
python: Reformat with Black, except quotes.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2021-02-12 13:11:19 -08:00
Anders Kaseorg
67e7a3631d
python: Convert percent formatting to Python 3.6 f-strings.
...
Generated by pyupgrade --py36-plus.
Signed-off-by: Anders Kaseorg <anders@zulip.com >
2020-06-10 15:02:09 -07:00
Aman Agrawal
47bf111de8
migrations: Mark RunPython statements elidable.
...
This will make django automatically remove them when we run
squashmigrations. There are still some RunSQL statements which
we will have to take care of manually.
2020-04-29 10:41:20 -07:00
Tim Abbott
69ae4931c3
migrations: Use django.db.backends.postgresql.schema.
...
This replaces django.db.backends.postgresql_psycopg2, which has been
an alias to django.db.backends.postgresql since Django 1.9.
2020-04-26 22:20:24 -07:00
Anders Kaseorg
c734bbd95d
python: Modernize legacy Python 2 syntax with pyupgrade.
...
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our
Python code except `zthumbor` and `zulip-ec2-configure-interfaces`,
followed by manual indentation fixes.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com >
2020-04-09 16:43:22 -07:00
Tim Abbott
8e7ce7cc79
python: Sort migrations/management command imports with isort.
...
This is a preparatory commit for using isort for sorting all of our
imports, merging changes to files where we can easily review the
changes as something we're happy with.
These are also files with relatively little active development, which
means we don't expect much merge conflict risk from these changes.
2020-01-14 13:07:47 -08:00
Anders Kaseorg
649235cfec
python: Remove unused imports.
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2019-02-22 16:54:36 -08:00
Anders Kaseorg
4bd28f7ae6
migrations: Remove unused imports.
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2019-02-02 17:01:04 -08:00
Tim Abbott
6827c42e02
migrations: Fix accounting in is_private migration.
...
The previous logic didn't correctly handle the case of total being 0.
Fixes #10378 .
2018-08-20 16:49:08 -07:00
Shubham Padia
40fdc4724b
migrations: Set initial value for is_private flags.
...
This initializes the is_private flag to have the correct value for
historical messages.
2018-08-09 16:09:44 -07:00