![]() Now I have the following DTO (Data transfer object): class CustomResponse(object):ĭef _init_(self, user_name, salary, dept_name): Salary=models.PositiveIntegerField(_("salary"))ĭept_name = models.CharField(max_length=30) Here are my Django models: class UserProfile(AbstractUser):Īge = models.PositiveIntegerField(_("age")) "Get me the user first name and department whose salary than XXX" I am designing my Django application to process a query and return response.įor example, I provide a REST API to get the results of the following query ![]() That is a GET request on user model returns the attributes of user object in JSON format if I use JSON serializer. ![]() Most of the tutorials on Django Rest Framework explains using the Django models and doing CRUD operations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |