Tukhtamurod
.
It depends in fact, the question is why you have a lot of requests? Because a lot of users accessing you site? Or are you talking about the number of accesses for a single user
Mohamed
Alright he can ask any question regarding django we are ready to help for free, he said about front end and I am sure there is a group for that
Yeah sure , but he even have no idea what frontend and backend is and somehow joined this group. that's why I'm trynna help
عــمــر
How can i make it 1 !
Mohamed
عــمــر
Mohamed
Then go an help him via dm
No one is restricting you from helping btw ☺️☺️
عــمــر
i have another question how can i filter objects by a 2 values in one field i want to get “Alex” and “Omar” Example model.object.filter(name=“alex”) model.object.filter(name=“omar”) How can I write it in single command ?
Tukhtamurod
Look __in lookup is: SELECT * FROM table WHERE <field_name> in (1st option, 2nd option, 3rd option.....)
Anonymous
thank mohammed farhan, i'm stupid,
Anonymous
black tiger, is tiger black
Marline
Hello I have two models Customer and Staff and I'm trying to add Role-based Access Control and I have been having some difficulties anyone who can help me?
عــمــر
Look __in lookup is: SELECT * FROM table WHERE <field_name> in (1st option, 2nd option, 3rd option.....)
Can i see the requests thats django request the database ? In the terminal
Tukhtamurod
When you inherit from AbstractBaseUser you also have to create your own UserManager
Marline
Have you implemented those models by inheriting from Abstract User or AbstractBaseUser?
I did something like this Customer(User): class Meta: proxy = True class Staff(User): class Meta: proxy = True
Tukhtamurod
Can i see the requests thats django request the database ? In the terminal
I dont think you can but not sure exactly, but if you wanna take full control over requests, directly use sql queries rather than ORM
Tukhtamurod
I did something like this Customer(User): class Meta: proxy = True class Staff(User): class Meta: proxy = True
Create CustomUser model there if they have same characters, but only differ according to is_staff or not, inherit from AbstractBaseUser, and create CustomUserManager too, you can take a look at django docs
Patrick
Hi everyone. Since I was always spending some seconds trying to remember that glorious website about django class based views (ccbv.co.uk) i created this domain that just redirects to the ccbv: djangocbv.dev it's easier for me to remember, so I thought someone else might find some use as well.
איש רגיל
'str' object has no attribute 'get' I'm trying to pass the value of one function to another. def send_post(request): ....global title ....title = form.cleaned_data["title"] ....return title def vkpost(request, title): ....message = title
איש רגיל
What should I change?
ㅤㅤㅤ
CommandError: can’t find xgettext . Make sure you have GNU gettext tools 0.15 or newer installed
ㅤㅤㅤ
Please help me
Charly
Please help me
Do you have installed gettext?
Uday
i have a model (LeaveList) i was saving all my data from template by doing leave_list = LeaveList() leave_list.xxx = 'something' leave_list.xxxx = 'somethingx' leave_list.save() which worked fine but now i have a date field whose format i have to change in the forms.py so i created a form (LeaveListForm) and did leave_list = LeaveListForm() how can i save data to model via the form?
Uday
i had to change the format in forms.py by doing class LeaveListForm(forms.ModelForm): from_date = forms.DateField(input_formats=settings.DATE_INPUT_FORMATS) to_date = forms.DateField(input_formats=settings.DATE_INPUT_FORMATS) which i cannot in models.py so i have to save data via forms
Anonymous
Hello
Anonymous
Can we integrate the adminlte template into django?
Ayobami
Yes
Charanjit Singh
Good morning Everyone. I wanted to assign user a role. And I am getting role value through url parameter. I am using django-rest-framework.. Please could someone help me
Meraj
hi everyone ; how to write an template tag that returns an value image from model !
Anmol
Can i not pass context into serializers.Serializer?
Anmol
class CompanyInviteView(views.APIView): serializer_class = companies_serializers.CompanyInviteSerializer permission_classes = [permissions.AllowAny] def get_object(self): try: return companies_models.Company.objects.get(id=self.kwargs['pk']) except companies_models.Company.DoesNotExist: raise Http404 def post(self, request, *args, **kwargs): company = self.get_object() serializer = companies_serializers.CompanyInviteSerializer(data=request.data, many=True, context={ 'company': company }) serializer.is_valid(raise_exception=True) serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED)
Anmol
And the create method doesn't run for some reason
Anmol
class CompanyInviteSerializer(serializers.Serializer): user_email = serializers.EmailField() def create(self, validated_data): return companies_models.CompanyInvite.objects.create(company=self.context.get('company'), user=self.user) def validate_user_email(self, user_email): self.user = users_models.User.objects.filter(email=user_email).first() if not self.user: raise serializers.ValidationError('user does not exist.') return user_email
Anmol
This is my serializer
Umar
I want to view the data present in model in form of table like datatables inside admin panel... Is there any way of doing that?
Vinay
Guys anyone share django3.1.6 complete document
Charly
Guys anyone share django3.1.6 complete document
https://docs.djangoproject.com/en/3.1/
Charly
The most complete ☝️
Vinay
Tqu👍🏼🤝🤓
Anonymous
Anybody got any idea about this
You need to implement adminform in admin.py
Anonymous
Sorry modeladmin
Anonymous
@Umar_Wani
Umar
You need to implement adminform in admin.py
Could you elaborate more plzz
Anonymous
Wait sending you code...chnage the code in your admin.py file
Viren
Hi Can anyone guide me how to do live camera streaming using firebase and Django?
Agent Q
Hi Can anyone guide me how to do live camera streaming using firebase and Django?
That's not something you can do with Firebase or Django. Look up WebRTC
Deleted
https://stackoverflow.com/questions/66309671/how-to-implement-ldap-login-in-django-without-knowing-the-ldap-server-info
Deleted
please help with this stack overflow question thanks
b
hey guys, how can I display multiple images at different places in a blog post?
Agent Q
Deleted
You can't login to ldap without knowing where to send the login request to
what's the hash md5 for in my case? they just give me this info
Agent Q
Agent Q
what's the hash md5 for in my case? they just give me this info
Just ask them a sample login and guide you through
Deleted
You tell me. The md5 hash can be anything
They use this hash in another app to login ldap
Agent Q
yes I do,
Then do it multiple times
Agent Q
They use this hash in another app to login ldap
How do they use it in another app?
b
Then do it multiple times
no what I mean is, multiple images in different places, like in blogs.. for ie first IMG is after 5 lines second is after 30 lines and etc
Deleted
How do they use it in another app?
It's a Java app, they only give me their code for generate login auth to ldap
b
Randomly?
wherever user wants to show them
Agent Q
yes
Use random module and determine the next line to load the static image
Agent Q
wherever user wants to show them
That's not random. That's specified.
b
That's not random. That's specified.
yes, for us it's random in code, we don't know where user want them to show
Agent Q
It's a Java app, they only give me their code for generate login auth to ldap
Ask them how to login with it. We can't help. Sorry
Agent Q
yes, for us it's random in code, we don't know where user want them to show
I assume it's in a rich text format that the user wants to load images?