Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get value of 1 field in model django

#Model:
class YourModel(models.Model):
    name = models.CharField(max_length=30)
    
#Then to get name attribute
queryset = YourModel.objects.get(id=1)
field_name = queryset.name
 
PREVIOUS NEXT
Tagged: #field #model #django
ADD COMMENT
Topic
Name
4+4 =