FireO icon indicating copy to clipboard operation
FireO copied to clipboard

How to get model class values in static method?

Open ericel opened this issue 3 years ago • 1 comments

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?

ericel avatar Mar 01 '22 04:03 ericel

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

AxeemHaider avatar Mar 01 '22 10:03 AxeemHaider