-
Multiple CRUD Models IdeaCreated multiple functions that used the original search function then combined them by overriding the search function on my CRUDController. So I know this would be a very very low priority and I will work on it myself if it is something that seems like a nice feature. The purpose is I want to create a "reports" page without rewriting all the table configs so I am attempting to use the normal list view The way I was doing it was overwriting the crud model on the what i call "child searches." Works good on getting most of the info, problem I'm having is the "skip" on the second model. I found a hackish way to go about it and just do a dropdown filter that changes the model and just use the plain index/search. I can get it to where it combines the data fine, but going to second page on datatable is where i'm having issues and have yet to find a solution. My databases are exactly the same but I wanted them separate as one is an "income" and one is an "expense" wanted better readability in the database. Thoughts? Maybe useful for somebody else in the future or waste of time? Just wanted feedback from the community if this is an idea people would like to see. Other issues I'm considering:
|
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 1 reply
-
Wooow. Never thought of this 😄 Yeah I imagine this requires quite a bit of hacking, your "child searches" principle sounds like a good one to achieve this with the current db architecture. But in a scenario like this, with Income and Expense, I think the most likely DB architecture is one db table, for both. Something like
And then (maybe) separate models, that would do stuff depending on the budget entry type, so At least that's how I would do it - because for large tables and reports you'll probably want to use SQL to add/substract/average stuff, instead of using PHP. And having them in one table would make that a lot easier. -- I'll be honest with you @AbbyJanke - I'm in the "out of scope" camp here atm 😄 I think it's a pretty particular use case, so I don't think we should support it out-of-the-box. But I can be convinced otherwise, I've been wrong before 🙄 |
Beta Was this translation helpful? Give feedback.
Wooow. Never thought of this 😄 Yeah I imagine this requires quite a bit of hacking, your "child searches" principle sounds like a good one to achieve this with the current db architecture.
But in a scenario like this, with Income and Expense, I think the most likely DB architecture is one db table, for both. Something like
budget_entries
, that would have:type
column (income/expense)type
column, just identify entry types based onvalue
being a positive/negative number;And then (maybe) separate models, that would do stuff depending on the budget entry type, so
Expense extends BudgetEntry
andIncome extends BudgetEntry
. Then you'd be able to create CRUDs for each one, or …