I have the following class with two static attributes (common to every instances)
class Seller:
fields = {
"url": True,
"availability": False,
"visibility": False,
"country": False,
"origin_website": False
}
required_fields = [f for f in Seller.fields.keys() if Seller.fields[f]]
def __init__(self):
...
When attempting to create an instance of seller, I get the following error.
required_fields = [f for f in Seller.fields.keys() if fields[f]]
NameError: name 'Seller' is not defined
I've tried to remove the Seller
reference, but it yields an another error
required_fields = [f for f in fields.keys() if fields[f]]
NameError: name 'fields' is not defined
I know I might miss something obvious as far as static variables are concerned, but can't figure what exactly.