zulip/zerver
Mateusz Mandera 1a8ad796f8 models: Replace __id syntax with _id where possible.
model__id syntax implies needing a JOIN on the model table to fetch the
id. That's usually redundant, because the first table in the query
simply has a 'model_id' column, so the id can be fetched directly.
Django is actually smart enough to not do those redundant joins, but we
should still avoid this misguided syntax.

The exceptions are ManytoMany fields and queries doing a backward
relationship lookup. If "streams" is a many-to-many relationship, then
streams_id is invalid - streams__id syntax is needed. If "y" is a
foreign fields from X to Y:
class X:
  y = models.ForeignKey(Y)

then object x of class X has the field x.y_id, but y of class Y doesn't
have y.x_id. Thus Y queries need to be done like
Y.objects.filter(x__id__in=some_list)
2021-04-22 14:53:00 -07:00
..
data_import models/realm: Add a model for storing realm playground information. 2021-04-07 08:20:53 +05:30
lib models: Replace __id syntax with _id where possible. 2021-04-22 14:53:00 -07:00
management models: Replace __id syntax with _id where possible. 2021-04-22 14:53:00 -07:00
migrations models: Replace __id syntax with _id where possible. 2021-04-22 14:53:00 -07:00
openapi emails: Rename "missed message email" to "message notification email". 2021-04-21 10:10:54 -07:00
templatetags dependencies: Upgrade to webpack-bundle-tracker 1.0.0-alpha.1. 2021-04-06 09:31:35 -07:00
tests emails: Rename "missed message email" to "message notification email". 2021-04-21 10:10:54 -07:00
tornado event_queue: Update rule for when we can remove compatibility code. 2021-04-16 09:58:21 -07:00
views models: Replace __id syntax with _id where possible. 2021-04-22 14:53:00 -07:00
webhooks integrations: Convert deprecated Django url to path. 2021-04-15 18:01:34 -07:00
worker queue_processors: Document when can remove compatibility code. 2021-04-16 09:55:14 -07:00
__init__.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
apps.py python: Reformat with Black, except quotes. 2021-02-12 13:11:19 -08:00
context_processors.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
decorator.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00
filters.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
forms.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00
logging_handlers.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
middleware.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00
models.py models: Replace __id syntax with _id where possible. 2021-04-22 14:53:00 -07:00
signals.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00