Skip to content

Using Pages inside Python Classes #540

Closed Answered by rodja
Slanderkin asked this question in Q&A
Discussion options

You must be logged in to vote

Interesting. I've never thought about that. But it's a really good question. FastAPI seems also unable to do this:

class Test:

    @app.get('/test')
    def test(self):
        return 'does this work?'

Returns a json stating "value self is missing" instead of "does this work?". But it does not mean that NiceGUI should fail here too. Are there any good reasons why this would be a bad idea?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@falkoschindler
Comment options

@Slanderkin
Comment options

Answer selected by Slanderkin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants