Thank you very much for your reply!
Not using foreign keys in the model is mainly to simplify the difficulty of repairing data.
Manually aggregate associated data in the view.
But now, due to the business related to exporting data, using association queries may be better/faster.
But I cannot change the data model class arbitrarily.
Not using foreign keys in the model is mainly to simplify the difficulty of repairing data.
Manually aggregate associated data in the view.
But now, due to the business related to exporting data, using association queries may be better/faster.
But I cannot change the data model class arbitrarily.
在2024年11月23日星期六 UTC+8 10:03:38<Sam Brown> 写道:
Why not use the ORM as intended? The ability to use field lookup syntax with foreign key fields is incredibly powerful. Probably worth the refactor time.On Fri, Nov 22, 2024 at 6:39 PM 'Ryan Nowakowski' via Django users <django...@googlegroups.com> wrote:You can use db_column:
<https://docs.djangoproject.com/en/5.1/ref/models/fields/#django.db.models.Field.db_column>On November 21, 2024 9:10:10 PM CST, "苏子阔" <zik...@gmail.com> wrote:In my project, I did not use foreign keys such as models ForeignKey. Instead, models were used BigIntegralField to associate with other tables
For example: customer-id=models BigIntegralField() stores the ID field of the customer table
But now what should I do if I want to use a join on query?
For example, TopUp. objects. select_delate ("customer-id").Please help me,thank you!--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/django-users/79205116-E740-4782-A832-F65563669A38%40fattuba.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/django-users/d82372f3-a183-4af0-9ccb-1f2e5e63bed3n%40googlegroups.com.
No comments:
Post a Comment