Python: Use django View instead of MethodView

Due to the 'only model most specific spec' logic highlighted in previous
commit, I'm changing away from MethodView/View, and use Django view instead.

In practice this shouldn't matter at all, but for writing tests it would
have been a nice fix to only have the "same name but more specific"
logic apply when it's the same _definition_ location. We used to have
this information available, but right now we don't... so instead of
spending a lot of time rewriting the core library, I simply used a
different class :D :O :(
This commit is contained in:
Rasmus Wriedt Larsen
2023-10-20 11:01:15 +02:00
parent 03aa2e27df
commit a956e1f613
2 changed files with 7 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
| Django.Views.View~Subclass | find_subclass_test | Member[View] |
| Django.Views.View~Subclass | find_subclass_test | Member[clash] |
| flask.MethodView~Subclass | find_subclass_test | Member[C] |
| flask.MethodView~Subclass | find_subclass_test | Member[MethodView] |
| flask.MethodView~Subclass | find_subclass_test | Member[clash] |
| flask.View~Subclass | find_subclass_test | Member[A] |
| flask.View~Subclass | find_subclass_test | Member[B] |
| flask.View~Subclass | find_subclass_test | Member[ViewAliasInExcept] |
@@ -8,4 +8,5 @@
| flask.View~Subclass | find_subclass_test | Member[ViewAlias] |
| flask.View~Subclass | find_subclass_test | Member[View] |
| flask.View~Subclass | find_subclass_test | Member[clash3] |
| flask.View~Subclass | find_subclass_test | Member[clash] |
| flask.View~Subclass | find_subclass_test | Member[complete_module_alias] |

View File

@@ -19,20 +19,20 @@ except:
if cond:
from flask.views import View as clash # $ MISSING
from flask.views import View as clash
else:
from flask.views import MethodView as clash # $ SPURIOUS: MethodView
from django.views.generic import View as clash # $ SPURIOUS: View=Django.Views.View~Subclass
if cond:
from flask.views import View as clash2 # $ MISSING
else:
from flask.views import MethodView as clash2 # $ MISSING
from django.views.generic import View as clash2 # $ MISSING
print(clash2)
if cond:
from flask.views import View as clash3
else:
from flask.views import MethodView as clash3 # $ MISSING
from django.views.generic import View as clash3 # $ MISSING
print(clash3)
import flask.views as containing_module_alias # $ MISSING