Created
September 5, 2022 02:10
-
-
Save andraantariksa/e524c2b7ba2044ecd71aeb16ce922f36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeTypedDict(TypedDict): | |
brands = forms.ModelChoiceField(required=True, queryset=None) | |
class MerchantBrandsForm(forms.Form, SomeTypedDict): | |
fields: SomeTypedDict | |
def __init__(self: merchant: Merchant, *args: Any, **kwargs: Any): | |
super().__init__(*args, **kwargs) | |
self.fields['brands'].queryset = merchant.brands.all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment