I'm going to create API with Django Rest Framework for an existing Django project. I would like to use models of existing app (product/models.py) in ' ...
I'm going to create API with Django Rest Framework for an existing Django project. I would like to use models of existing app (product/models.py) in ' ...
I have the following models and serializers. I want a situation that when I make a request to my List Controller index, I get Expected Json. Please se ...
lets say I have a method as follows now this works and it returns me my custom serializer, but if I want to add custom keys to the payload like {da ...
I have a Kit model with it's serializer: I need to use this serializer to render all of my Kits like this: My route I get an error: It's m ...
I have an Rails 7 API and i'm using gem 'active_model_serializers', '~> 0.10.0' to make het fit in the json_api requirements, but i need to in the ...
I want to render a part of embed model's fields . I wrote bellow code. But, I got a response include all embed model's fields. class RacesController ...
In ReviewsController serializers are used to display json. Like here: The serializer uses the following attribute :image. Like this: A helper 'r ...
I would like to use ActiveModelSerializers on the result of a rawSQL query in Rails. Can't find a way to do it. I've tried several options: give ...
This is my first time to use active_model_serializers gem, I have been looking around the documentation and have not found a solution. I have followe ...
Consider the following code class AuthenticatedController < ApplicationController rescue_from InvalidCredentials, with: :unauthenticated def ...
Just as the title says, how should I sort the api using the attribute in Active Model Serializer in Rails? I have an example api consist of shopping ...
I upgraded activemodel serializer and now the output is different than what it once was. I'm trying to get the JSON output to match what it previously ...
The article serializer: settings: model: view function: i just created a simple serializer but whenever i try to get the response it says ...
I am creating an ecommerce website using Django-rest-framework and react. I am trying to add items to cart. I am able to add items to the cart on the ...
I have a database that I cannot modify as it is a read-only populated from a node I don't control. This causes the tables to have foreign_keys that a ...
The AnimalSerializer sits in animal_engine/app/serializers/api_handler/api/private/mobile_app/v8 Weirdly serializing a single item works. I get th ...
I have a serializer like this: My issue is that when instantiating the serializer and calling as_json on it, I get the following: But my front e ...
Actually, I am trying to validate the fields which are given in serializers Note: Issue is in the validation fields. It was working fine before add ...
I need to make a condition so that events that have a date less than the current date are not displayed in the JSON and only see the upcoming events. ...
Here I want to put condition on action basic of the controller. For example I will like to send conditional_attributes for only index action and no ...