-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
It would be nice to be able to treat a function that returns a table as a Model in Django.
I'm thinking something along the lines of what's already in the View class, but a function gets called instead.
The reason for using a function is to create more powerful "views" that can be generated, and queried, at runtime.
It will need extra information so that the sync command can create the function names, arguments etc.
An example:
class MyFunc(TableFunction):
class Meta:
arguments = (
( 'arg1', 'DATE'),
)
sql = 'SELECT my_column FROM my_table WHERE some_date = $1'
my_column = models.CharField()The idea is still a little poorly-formed in my mind, so I'll try and put some sample code together and see if I can get the result I want before pushing anything.
Metadata
Metadata
Assignees
Labels
No labels