Skip to content

Instantly share code, notes, and snippets.

View ehsan-hn's full-sized avatar
🏠
Working from home

ehsan ehsan-hn

🏠
Working from home
View GitHub Profile
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@agusmakmun
agusmakmun / serializer.py
Last active July 22, 2024 19:25
Sample Upload image with Django Rest Framework.
from rest_framework import serializers
from evotee.models import Candidate
class CandidateSerializer(serializers.ModelSerializer):
selection = serializers.CharField(
source='selection.code',
read_only=True
)
photo = serializers.ImageField(