Skip to content

Instantly share code, notes, and snippets.

View joelcb23's full-sized avatar

Daikon Dev joelcb23

View GitHub Profile
@joelcb23
joelcb23 / inventory_serializers.py
Last active January 4, 2026 18:23
This gist contains a simplified example of a backend CRUD API built with Django Rest Framework, using Class-Based Views and serializers. The code is part of a small inventory management system where users can create, update, retrieve, and delete products. The main goal of this example is to show how I organize backend code by responsibilities, k…
from rest_framework import serializers
from .models import Brand, Category, Product
class BrandSerializer(serializers.ModelSerializer):
"""
Serializer for Brand model
fields:
name: CharField, required
created_at: DateTimeField, read only