Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django get fields data from object model

field_name = 'name'
obj = MyModel.objects.first()
field_object = MyModel._meta.get_field(field_name)
field_value = field_object.value_from_object(obj)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #fields #data #object #model
ADD COMMENT
Topic
Name
7+4 =