Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HashModel Product is empty when imported to other files #1

Open
AdityaPunetha opened this issue Apr 12, 2023 · 0 comments
Open

HashModel Product is empty when imported to other files #1

AdityaPunetha opened this issue Apr 12, 2023 · 0 comments

Comments

@AdityaPunetha
Copy link
Owner

HashModel Products in declared in inventory/main.py as

class Product(HashModel):
    name: str
    price: float
    quantity: int

    class Meta:
        database = redis

This works as intended when accessed within the own file through FastAPI methods and is able to store information and perform CRUD methods.

But when imported and accessed through another file (inventory/debug.py) it's empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant