I am new to django. While referring to django check framework documentation, I came across the following points :-
Field names must not end with an underscore.
Field names must not contain "__".
This restrictions exist because django uses
__ in filter lookups.
Django offers a powerful and intuitive way to “follow” relationships in lookups, taking care of the SQL JOINs for you automatically, behind the scenes. To span a relationship, just use the field name of related fields across models, separated by double underscores, until you get to the field you want.
So having it in field name will mess up lookup resolution
For trailing underscore is same reason. if you have it in field name separation will be messed up
test___field.split('__') will become
['test', '_field'] not