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

How to get model class values in static method? #150

Open
ericel opened this issue Mar 1, 2022 · 1 comment
Open

How to get model class values in static method? #150

ericel opened this issue Mar 1, 2022 · 1 comment

Comments

@ericel
Copy link

ericel commented Mar 1, 2022

I want to get the field value like we use self in Django models.

class UserModel(Model):
    id = IDField()
    uid = TextField()
    @classmethod
     def get_user(cls):
            return cls.uid

The class method, keep returning NONE instead of the string value of the uid field. Did I miss something?

@AxeemHaider
Copy link
Contributor

These class properties are removed by FireO here you can check it if you want to get field values you have to check how MetaModel is working.
You can get value from self.field_list

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

2 participants