Open SantitoSB opened 2 years ago
You should inherit ComputeField
and rewrite get_value
, then add it in fields
what fields do you mean? in MyResource description or in?
class Model(Resource):
fields: List[Union[str, Field, ComputeField]] = []
I get dict in get_value but I don't see any computed field in it? Is there any examples of code?
Hi! I'm try to use compute field in fastapi admin. def full_name(self) -> str: return self.first_name + ' ' + self.last_name resource description: ComputeField( name="fullname", label="Full name", display=displays.Display(), input=inputs.DisplayOnly(), ), But I get None in my admin panel. Can you help me? Versions: fastapi==0.68.0 pydantic==1.8.2 tortoise-orm==0.17.3 fasapi-admin==1.0.3