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?
taylor price

★

roma★
Not today Justin
Mike Driver
The Bowery Presents

Jar Jar Binks Fan Club

Origami Around
Fai_Ryy
Monterey Bay Aquarium
hello vonnie
RMH

titsay
we're not kids anymore.
KIROKAZE

#extradirty

Discoholic 🪩
Cosimo Galluzzi

izzy's playlists!
seen from Mexico
seen from United States

seen from United Kingdom

seen from United States
seen from Portugal
seen from Namibia
seen from Germany

seen from Malaysia

seen from Türkiye
seen from United States
seen from Algeria
seen from Sweden

seen from Malaysia
seen from United States

seen from Chile
seen from Saudi Arabia
seen from United States
seen from United States
seen from United States

seen from Malaysia
@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')