Javi
+1 to Stripe
Javi
I did implemented paypal and stripe and the different is huge
Daniel
Telegram Passport
Javi
Also paypal rules are a bit weird
Rust
Telegram Passport
Which payment systems already support it?
Jimmies San
Telegram Passport
yes it's an idea but too much new
Daniel
also, I'm pretty sure you can pay with Telegram
Rust
also, I'm pretty sure you can pay with Telegram
Never saw/used successfull implementations :(
Rust
And telegram is not forcing their payments at all
Daniel
Never saw/used successfull implementations :(
yep, there are not so many tuts on using the Telegram Payment API, except for the official documentation from them
Daniel
true
Daniel
although, it supports most of the payment providers, including Stripe
Anonymous
Who has used flutterwave before
Anonymous
Who has used flutterwave before
its a Nigerian payment system
Django Bot
>> Links - GitHub - makimo/django-eav2: Django EAV 2 - EAV storage for modern Django
Sharif
hi, i need help
Sharif
i heve this error
Sharif
connection did not
Sharif
mysql database
Anonymous
Hi, can anyone explain to me what's difference between this two code? class SnippetDetail(mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, generics.GenericAPIView): queryset = Snippet.objects.all() serializer_class = SnippetSerializer def get(self, request, *args, **kwargs): return self.retrieve(request, *args, **kwargs) def put(self, request, *args, **kwargs): return self.update(request, *args, **kwargs) class SnippetList(generics.ListCreateAPIView): queryset = Snippet.objects.all() serializer_class = SnippetSerializer when we should use the first one and when the second one?
Mounikesh
*rud precisely
oops sorry
Anonymous
the first one equals with RetrieveUpdateDestroyAPIView its wrapper for handling single object (detail of data / a row of table) while the later for post new row data and get all table row data
emmm, so they are same in logic i mean they are do something different but they are using the same way and what's diffrenece between generic and APIView? when should I use generic and when I should use APIView?
Anonymous
and again sorry for my bad English 😐
inchidi
emmm, so they are same in logic i mean they are do something different but they are using the same way and what's diffrenece between generic and APIView? when should I use generic and when I should use APIView?
if you familiar with django generic cbv, APIView equals with View and generics equals with generic. generic/s wrap your view to work with certain model
Anonymous
oops sorry
Thank you for your time
inchidi
emmm, so they are same in logic i mean they are do something different but they are using the same way and what's diffrenece between generic and APIView? when should I use generic and when I should use APIView?
and for "when should you use APIView" it depends on you coz basically they are just python classes. but imagine you want to make a dashboard, with gauge that count how much data you have, you will think that APIView is a good choice.
Anonymous
and for "when should you use APIView" it depends on you coz basically they are just python classes. but imagine you want to make a dashboard, with gauge that count how much data you have, you will think that APIView is a good choice.
I want to develope something for food ordering, i want to make something for submit food that user want and other stuff like that, what is your suggestions? perhaps i should make a dashboard for users and another for admins and so on. can u help me to undestand how i should do it?
Anonymous
Ok i will :D
inchidi
i made simple example of drf with generics, hope it helps
Anonymous
I want to know about best practice of this. maybe i need to do this first and then harden it
Anonymous
Even after so much I have yet to try Django Rest Framework
Anonymous
Can anyone tell me what does it provide that vanilla Django doesn't
inchidi
Can anyone tell me what does it provide that vanilla Django doesn't
(general/particular) pagination, permission, status response, filter, search, and viewset/generics paradigm
inchidi
serializing relationship much easier & faster with drf also
inchidi
(general/particular) pagination, permission, status response, filter, search, and viewset/generics paradigm
class UserAPIView(generics.ListCreateAPIView):     serializer_class = UserProfileSerializer     permission_classes = (permissions.AllowAny,)     queryset = User.objects.filter(user__is_staff=False, user__is_superuser=False) this 4 lines of code already handle what i said there
Anonymous
Again, I wanted to ask what extra it provides?
inchidi
what do you mean by extra?
Anonymous
I dunno 😒
inchidi
of course you can create everything drf provide from scratch
Anonymous
With little to some work
inchidi
actually thats a lot
Anonymous
Educate me
inchidi
note that drf not only provide wrapper for views, but serializer, and url/router also
Anonymous
note that drf not only provide wrapper for views, but serializer, and url/router also
Hi again :D stupid question again :D sorry class FoodCreation(mixins.CreateModelMixin, generics.GenericAPIView): queryset = Food.objects.all() serializer_class = FoodSerializer def post(self, request, *args, **kwargs): return self.create(request, *args, **kwargs) i wrote this for create new food but my model has this user = models.ForeignKey(User, on_delete=models.CASCADE) so serializer need user but i want to fill it with request what should i do?
Mahesh
It's not related to django..
Mahesh
It's related to design
Mahesh
design
See my pm
Anonymous
Are this same? class OrderList(generics.ListAPIView): class OrderList(mixins.ListModelMixin, generics.GenericAPIView):
inchidi
class FoodCreation(CreateAPIView): queryset = Food.objects.all() serializer_class = FoodSerializer def perform_create(self, serializer): serializer.save(user=self.request.user) your code will looks like this
inchidi
true, theres also perform_destroy, perform_update, etc. all explained in the docs
Anonymous
true, theres also perform_destroy, perform_update, etc. all explained in the docs
oh my bad, i didn't undestand your message before this message, that one mentioned to docs, thanks
inchidi
so i can't use perform_create function in GenericAPIView, Am i right?
no, you can. https://github.com/encode/django-rest-framework/blob/a251b9379200420062cad9e3c68fde7c0e6b3fdc/rest_framework/generics.py#L186
Anonymous
no, you can. https://github.com/encode/django-rest-framework/blob/a251b9379200420062cad9e3c68fde7c0e6b3fdc/rest_framework/generics.py#L186
i read this also i searched in duckduck, :( but still i can't solved this ... class OrderCreation(mixins.CreateModelMixin, generics.GenericAPIView): queryset = Order.objects.all() serializer_class = OrderSerializer def perform_create(self, serializer): serializer.save(user=self.request.user) def post(self, request, *args, **kwargs): return self.create(request, *args, **kwargs) is this right? also i try this class OrderCreation(generics.CreateAPIView): queryset = Order.objects.all() serializer_class = OrderSerializer def perform_create(self, serializer): serializer.save(user=self.request.user) but i get this error "user": [ "This field is required." ]
inchidi
how's your OrderSerializer looks like?
Anonymous
what you can't solve?
I want to fill pk field for a foreign key and manytomany field of model, i sent manytomany field with form but i want to fill foreign key I mean user field with self.request.user but i got that error
Anonymous
how's your OrderSerializer looks like?
class OrderSerializer(serializers.ModelSerializer): class Meta: model = Order fields = '__all__'
Anonymous
how's your OrderSerializer looks like?
I'm truly sorry for my low level questions