Hi, i am creator django-python-notes blog. Sorry, i forgot this blog over a year ago. I want to ask something of you. You want to see new notes in the blog?

oozey mess
YOU ARE THE REASON

blake kathryn

tannertan36
we're not kids anymore.

@theartofmadeline
Today's Document
Jules of Nature
he wasn't even looking at me and he found me
RMH

pixel skylines
Sweet Seals For You, Always

Origami Around
Mike Driver
One Nice Bug Per Day

Kaledo Art

titsay
KIROKAZE

let's talk about Bridgerton tea, my ask is open
seen from Syria
seen from Ukraine

seen from Malaysia

seen from United States
seen from South Africa

seen from Malaysia

seen from Ireland
seen from United States
seen from Colombia
seen from Türkiye

seen from United States

seen from Türkiye

seen from United States
seen from United States
seen from India
seen from Türkiye

seen from Singapore
seen from South Africa

seen from Singapore
seen from United States
@django-python-notes
Hi, i am creator django-python-notes blog. Sorry, i forgot this blog over a year ago. I want to ask something of you. You want to see new notes in the blog?

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
request.user returns a SimpleLazyObject
if hasattr(user, '_wrapped') and hasattr(user, '_setup'):
      if user._wrapped.__class__ == object:
        user._setup()
      user = user._wrapped
Queryset + Queryset
querysets = queryset1 | queryset2
Making queries "time"
Article.objects.filter(time__year=2013, time__month=4, time__day=10)
Making queries "starts with"
SomeModel.objects.filter(name__startswith='test_')

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Example APIView
class SomeView(APIView): serializer_class = SomeSerializer def post(self, request): serializer = self.get_serializer(data=request.DATA) if serializer.is_valid(): return Response({'some_data': '9000'}) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) class SomeSerializer(serializers.Serializer): field = serializers.CharField(max_length=255) def validate(self, attrs): field = attrs.get('field') if len(field) < 10: raise serializers.ValidationError('Filed too small!') if field == 'Duck': raise serializers.ValidationError('No duck') return attrs
Pagination in the generic views
class PaginatedListView(ListAPIView): model = ExampleModel serializer_class = ExampleSerializer paginate_by = 10 paginate_by_param = 'page_size'
Serializer method field or not model field
class MySerializer(serializers.ModelSerializer): name = serializers.SerializerMethodField('get_name') def get_name(self, obj): return '%s %s' % (obj.firstname, obj.lastname) class Meta: model = SomeModel fields = ('firstname', 'lastname', 'avatar')