Did I find the right examples for you? yes no

All Samples(6)  |  Call(0)  |  Derive(0)  |  Import(6)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/d/j/django-rest-framework-mongoengine-HEAD/rest_framework_mongoengine/SampleApp/views.py   django-rest-framework-mongoengine(Download)
    def post(self, request, format=None):
        serializer = BlogSerializer(data=request.DATA, many=False)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
    def post(self, request, format=None):
        serializer = UserSerializer(data=request.DATA, many=False)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
    def post(self, request, format=None):
        serializer = PostSerializer(data=request.DATA, many=False)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
    def post(self, request, format=None):
        serializer = CommentSerializer(data=request.DATA, many=False)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)

src/z/a/zamboni-HEAD/mkt/developers/api_payments.py   zamboni(Download)
                               status=status.HTTP_500_INTERNAL_SERVER_ERROR)
            serializer = self.get_serializer(obj)
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(form.errors, status=status.HTTP_400_BAD_REQUEST)
 

src/a/t/atmosphere-HEAD/api/project.py   atmosphere(Download)
            response = Response(
                    serializer.data,
                    status=status.HTTP_201_CREATED)
            return response
        else:
            response = Response(
                    serializer.data,
                    status=status.HTTP_201_CREATED)
            return response
        else:
            response = Response(
                    serializer.data,
                    status=status.HTTP_201_CREATED)
            return response
        else:

src/z/a/zamboni-HEAD/mkt/webpay/views.py   zamboni(Download)
        )
 
        return Response(token, status=status.HTTP_201_CREATED)
 
 
        )
 
        return Response(token, status=status.HTTP_201_CREATED)
 
 

src/z/a/zamboni-HEAD/mkt/comm/views.py   zamboni(Download)
        return Response(
            NoteSerializer(note, context={'request': self.request}).data,
            status=status.HTTP_201_CREATED)
 
    def mark_as_read(self, profile):
        return Response(
            NoteSerializer(note, context={'request': request}).data,
            status=status.HTTP_201_CREATED)
 
    def mark_as_read(self, profile):
        return Response(
            NoteSerializer(note, context={'request': request}).data,
            status=status.HTTP_201_CREATED)
 
    def mark_as_read(self, profile):
 
    consume_email.apply_async((email_body,))
    return Response(status=status.HTTP_201_CREATED)
 

src/d/e/deis-HEAD/controller/api/views.py   deis(Download)
        assign_perm(self.perm, user, app)
        models.log_event(app, "User {} was granted access to {}".format(user, app))
        return Response(status=status.HTTP_201_CREATED)
 
    def destroy(self, request, **kwargs):
    def create(self, request, **kwargs):
        user = get_object_or_404(User, username=request.DATA['username'])
        user.is_superuser = user.is_staff = True
        user.save(update_fields=['is_superuser', 'is_staff'])
        return Response(status=status.HTTP_201_CREATED)
        app.deploy(new_release)
        msg = "Rolled back to v{}".format(version)
        return Response(msg, status=status.HTTP_201_CREATED)
 
 

src/a/t/atmosphere-HEAD/api/instance.py   atmosphere(Download)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        else:
            return Response(serializer.errors,

src/m/o/movide-HEAD/api/views.py   movide(Download)
    def post(self, request, format=None):
        serializer = ClassgroupSerializer(data=request.DATA, context={'request': request})
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
    def post(self, request, format=None):
        serializer = RatingSerializer(data=request.DATA, context={'request': request})
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
    def post(self, request, format=None):
        serializer = MessageSerializer(data=request.DATA, context={'request' : request})
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        else:
            return Response(serializer._errors, status=status.HTTP_400_BAD_REQUEST)
    def post(self, request, format=None):
        serializer = EmailSubscriptionSerializer(data=request.DATA, context={'request' : request})
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)

src/z/a/zamboni-HEAD/mkt/collections/views.py   zamboni(Download)
        # Now create the collection.
        result = self.create(request)
        if result.status_code != status.HTTP_201_CREATED:
            return result
 
 
        # Re-Serialize to include apps.
        return self.return_updated(status.HTTP_201_CREATED,
                                   collection=self.object)
 

src/z/a/zamboni-HEAD/mkt/submit/views.py   zamboni(Download)
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.status import (HTTP_201_CREATED, HTTP_202_ACCEPTED,
                                   HTTP_400_BAD_REQUEST)
from rest_framework.viewsets import GenericViewSet
        upload = self.get_object()
        serializer = self.get_serializer(upload)
        status = HTTP_201_CREATED if upload.processed else HTTP_202_ACCEPTED
        return Response(serializer.data, status=status)
 
        log.info('Preview created: %s' % form.instance)
        serializer = self.get_serializer(form.instance)
        return Response(serializer.data, status=HTTP_201_CREATED)
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next