Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to pass additionnal models to Func for formatting #150

Conversation

christophehenry
Copy link

@christophehenry christophehenry commented Mar 6, 2024

Add an optionnal 'additionnal_models' attribute to Func allowing to specify additionnal models to pass to formatting function. Useful for SQL queries that involve multiple tables.

Type: feature

@christophehenry christophehenry force-pushed the func-arbitrary-models branch 2 times, most recently from 07e607f to 0b474f1 Compare March 13, 2024 09:28
@christophehenry christophehenry force-pushed the func-arbitrary-models branch from 0b474f1 to 2e5bd2e Compare April 9, 2024 13:13
@christophehenry christophehenry force-pushed the func-arbitrary-models branch from 2e5bd2e to 3a046c1 Compare May 6, 2024 08:37
@christophehenry
Copy link
Author

Can I have a feedback here? I think this is ready for a merge.

Add an optionnal 'additionnal_models' attribute to Func allowing to specify additionnal models to pass to fun formatting. Useful for SQL queries that involve multiple tables.

Type: feature
@christophehenry christophehenry force-pushed the func-arbitrary-models branch from 3a046c1 to d97c4ed Compare May 6, 2024 08:51
@wesleykendall
Copy link
Member

Thanks for your suggestion. I'm thinking that this may be too specific of a context variable at the moment to go in the main library. There have been a few requests for extending Func, and I think I'd like to just support Django's template rendering system and either a) pass in all model metadata as a var or b) have a template tag.

In any case, for now you should still be able to subclass Func and use this change in your project. I will open a discussion about better template rendering and if this belongs in the library or in a third-party extension

@christophehenry
Copy link
Author

Awesome!

@christophehenry christophehenry deleted the func-arbitrary-models branch August 29, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants