#5519 (Implement dynamic Model.objects.using method.)
by Sharif Mehedi · in Developers · assigned to Sharif Mehedi
Kurzbeschreibung
Kinder
Kommentare
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : So let's close this ticket and move on.
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : Yes, we can declare SpanningForeignKey and dynamic using to be antifeatures. And also the "multiple databases" feature in TIM (which is being used in one or two production sites, and which made me say that multiple databases makes sense for pronto) is probably not needed in Lino because a database s...
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : Sure I can try. But I am starting to think it an anti-feature.
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : Can you create a demo project in book in order to show the feature?
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) (1 Antwort) : That was my initial idea tho. And in our earlier discussion, you suggested to use multiple databases. I can try both tho, a SpanningForeignKey is still a feature we might use in other cases.
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) (2 Antworten) : Another idea for your use case in Pronto is to extend the ledger plugin so that it supports multiple ledgers on a same site. A choicelist or database model "Ledgers", and a field ledger_id on User and Account.
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : Also, we need to have a different kind of ForeignKey for such a feature.
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : It was documented in django docs that foreign relation across multiple databases is NOT supported. Which I wanted to check for my own. Afterwards I looked for solutions. Where I think I found one. But with such a solution, query lookup for other fields (than pk) on the Foreign Object is probably NOT...
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) (1 Antwort) : As we've discussed before, it's about the company ledgers and journals in pronto. One site for one company will make a lot of waste in server resources. Don't worry about it, I think I found a good solution for this. Let me try it out
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : Which makes me ask once more: why do you want multiple databases? I have the feeling that multiple databases is not the good solution to your problem. But what is the problem you want to solve?
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : There's still another overhead with multiple databases, across multiple databases, the relations are NOT possible, hence, the relational constraints on database objects across multiple databases are also NOT possible. What we can do is that, we can store relational primary keys on IntegerFields and ...
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : Why don't you create one Lino Pronto site per company? Which database models will they share?
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : If you are available, let's talk about it tomorrow morning.
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : It's the get_request_objects, method that we talked about. To have separate databases for different users. Example use case, in lino_pronto each company could have it's own database for storing their ledger info and journals.
- 2 Jahre, 5 Monate ago von Luc Saffre about #5519 (Implement dynamic Model.objects.using method.) : Please explain this feature. What would be the advantage? Why do we want it?
- 2 Jahre, 5 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : For this feature, we need to completely redesign the migrations/initdb and loaddata techniques.
- 2 Jahre, 7 Monate ago von Sharif Mehedi about #5519 (Implement dynamic Model.objects.using method.) : Created new Ticket #5519 (Implement dynamic Model.objects.using method.).