Skip to content

Instantly share code, notes, and snippets.

yuan6785 /
Created August 3, 2022 07:06 — forked from toransahu/
Writable Nested Serializers | Multiple Images Upload | DRF
#!/usr/bin/env python3.6.4
# coding="UTF-8"
__author__ = 'Toran Sahu <>'
__copyright__ = 'Copyright (C) 2018 Ethereal Machines Pvt. Ltd. All rights reserved'
from django.db import models
from os import path
from utils import directory_path_with_id
yuan6785 /
Created January 10, 2020 10:29 — forked from hakib/
How to Turn Django Admin Into a Lightweight Dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):
yuan6785 /
Created May 7, 2019 09:08 — forked from skt7/
Dominant Colors in an image using python opencv and scikit-learn
import cv2
from sklearn.cluster import KMeans
class DominantColors:
IMAGE = None