improvements to FlaskResource#55
improvements to FlaskResource#55asldevi wants to merge 2 commits intotoastdriven:masterfrom asldevi:master
Conversation
… end points without this, using `FlaskResource.as_view` results in "TypeError: _wrapper() takes at least 1 argument (0 given)"
|
Hey @asldevi! Could you please provide some tests in order to avoid regression? |
|
Hi @asldevi, I love this feature, but I'd like to suggest something a little different. Maybe instead of specifying class MyResource(FlaskResource):
instance_rule = r'<int:my_primary_key>/'
def detail(self, my_primary_key):
passSince the format of the parameters are tightly bound to the implementing class, and not to the Flask URL setup. Ideally, though, I'd like to be able to say: class MyResource(XXXResource):
def detail(self, my_primary_key: int):
passAnd have that independent of the specific EDIT: Okay, I realise that this is an OLD issue, so if nobody has any complaints, I might go ahead and implement it myself? ;) |
|
@madsmtm If you are avaiable, I think would be really nice! |
add_url_rulestakes the primary key name and its type and passes on to Flaskadd
as_viewin FlaskResource, which is required for creating custom end points dynamically