order_by function gets error if the field name or json key, has a dash.

2019-01-13 Thread Jonathan Espinal
order_by function gets error if the field name or json key, has a dash. I know Django use a dash for asc or desc methods. but in this case the dash is in the middle. EXAMPLE: MyTable.objects.all().order_by('myfield__en-us') I have a jsonb field like: { "es": "Casa", "en-us": "House"

I have a question with "ModelForm"

2013-10-27 Thread Jonathan Espinal
I have a question with "ModelForm", I have a accounts model with a foreignkey on users model, when I try to save a record using "ModelForm", the SQL "debug_toolbar" show my 2 aditionals query: "SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser"