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
عــمــر
Tukhtamurod
Tarun
Charly
عــمــر
How can i make it 1 !
Mohamed
Tukhtamurod
عــمــر
عــمــر
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
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?
عــمــر
Tukhtamurod
Tukhtamurod
When you inherit from AbstractBaseUser you also have to create your own UserManager
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
Sadra
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
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
Charly
The most complete ☝️
Vinay
Tqu👍🏼🤝🤓
Umar
Anonymous
Sorry modeladmin
Anonymous
@Umar_Wani
Umar
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
Viren
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
Agent Q
Deleted
Agent Q
Agent Q
b
Agent Q
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
Agent Q
b
Agent Q
yes
Use random module and determine the next line to load the static image
Agent Q
Agent Q