How to use get_queryset method in Kiwi

Best Python code snippet using Kiwi_python

manager.py

Source:manager.py Github

copy

Full Screen

...5 # This manager should be used for queries on related fields6 # so that geometry columns on Oracle and MySQL are selected7 # properly.8 use_for_related_fields = True9 def get_queryset(self):10 return GeoQuerySet(self.model, using=self._db)11 def area(self, *args, **kwargs):12 return self.get_queryset().area(*args, **kwargs)13 def centroid(self, *args, **kwargs):14 return self.get_queryset().centroid(*args, **kwargs)15 def collect(self, *args, **kwargs):16 return self.get_queryset().collect(*args, **kwargs)17 def difference(self, *args, **kwargs):18 return self.get_queryset().difference(*args, **kwargs)19 def distance(self, *args, **kwargs):20 return self.get_queryset().distance(*args, **kwargs)21 def envelope(self, *args, **kwargs):22 return self.get_queryset().envelope(*args, **kwargs)23 def extent(self, *args, **kwargs):24 return self.get_queryset().extent(*args, **kwargs)25 def extent3d(self, *args, **kwargs):26 return self.get_queryset().extent3d(*args, **kwargs)27 def force_rhr(self, *args, **kwargs):28 return self.get_queryset().force_rhr(*args, **kwargs)29 def geohash(self, *args, **kwargs):30 return self.get_queryset().geohash(*args, **kwargs)31 def geojson(self, *args, **kwargs):32 return self.get_queryset().geojson(*args, **kwargs)33 def gml(self, *args, **kwargs):34 return self.get_queryset().gml(*args, **kwargs)35 def intersection(self, *args, **kwargs):36 return self.get_queryset().intersection(*args, **kwargs)37 def kml(self, *args, **kwargs):38 return self.get_queryset().kml(*args, **kwargs)39 def length(self, *args, **kwargs):40 return self.get_queryset().length(*args, **kwargs)41 def make_line(self, *args, **kwargs):42 return self.get_queryset().make_line(*args, **kwargs)43 def mem_size(self, *args, **kwargs):44 return self.get_queryset().mem_size(*args, **kwargs)45 def num_geom(self, *args, **kwargs):46 return self.get_queryset().num_geom(*args, **kwargs)47 def num_points(self, *args, **kwargs):48 return self.get_queryset().num_points(*args, **kwargs)49 def perimeter(self, *args, **kwargs):50 return self.get_queryset().perimeter(*args, **kwargs)51 def point_on_surface(self, *args, **kwargs):52 return self.get_queryset().point_on_surface(*args, **kwargs)53 def reverse_geom(self, *args, **kwargs):54 return self.get_queryset().reverse_geom(*args, **kwargs)55 def scale(self, *args, **kwargs):56 return self.get_queryset().scale(*args, **kwargs)57 def snap_to_grid(self, *args, **kwargs):58 return self.get_queryset().snap_to_grid(*args, **kwargs)59 def svg(self, *args, **kwargs):60 return self.get_queryset().svg(*args, **kwargs)61 def sym_difference(self, *args, **kwargs):62 return self.get_queryset().sym_difference(*args, **kwargs)63 def transform(self, *args, **kwargs):64 return self.get_queryset().transform(*args, **kwargs)65 def translate(self, *args, **kwargs):66 return self.get_queryset().translate(*args, **kwargs)67 def union(self, *args, **kwargs):68 return self.get_queryset().union(*args, **kwargs)69 def unionagg(self, *args, **kwargs):...

Full Screen

Full Screen

payment_card_views.py

Source:payment_card_views.py Github

copy

Full Screen

1from rest_framework import generics, permissions, authentication, status, mixins2from lib.response import Response3from lib.card_validator import card_validator4from db.models.learner import LearnerProfile5from api.serializers.serializers import LearnerCardSerializer6class LearnerCardView(7 mixins.RetrieveModelMixin,8 mixins.UpdateModelMixin,9 mixins.DestroyModelMixin,10 generics.GenericAPIView11):12 '''13 This viewset generates the endpoint for:14 card creation, reading update and delete 15 '''16 permission_classes = (permissions.IsAuthenticated,) 17 authentication_classes = [authentication.SessionAuthentication, 18 authentication.TokenAuthentication,19 authentication.BasicAuthentication]20 serializer_class = LearnerCardSerializer21 queryset = LearnerProfile.objects.all()22 23 def get(self, request, *args, **kwargs): 24 get_queryset = LearnerProfile.objects.get(user_id=request.user)25 response = {26 'account_name': get_queryset.account_name,27 'account_number': get_queryset.account_number,28 'bank_name': get_queryset.bank_name29 }30 return Response(response)31 def post(self, request, *args, **kwargs):32 get_queryset = LearnerProfile.objects.get(user_id=request.user)33 serializer = LearnerCardSerializer(data=request.data)34 if serializer.is_valid(raise_exception=True):35 return card_validator(self, get_queryset, serializer)36 return Response(None, {'Invalid request': 'Please enter valid data'})37 def put(self, request, *args, **kwargs):38 get_queryset = LearnerProfile.objects.get(user_id=request.user)39 serializer = LearnerCardSerializer(data=request.data)40 if serializer.is_valid(raise_exception=True):41 return card_validator(self, get_queryset, serializer)42 return Response(None, {'Invalid request': 'Please enter valid data'}) 43 44 def delete(self, request, *args, **kwargs):45 get_queryset = LearnerProfile.objects.get(user_id=request.user)46 get_queryset.account_name = None47 get_queryset.account_number = None48 get_queryset.bank_name = None49 get_queryset.save()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Kiwi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful