Anonymous
Decimal raise error if compared with non decimal instances
Anonymous
Have you tried field__gte=Decimal(0.1) ?
Cesar
Alex
Is there any way to so it through template any tag?
Sure. You can simply define a custom template tag and pass to it the request object {% mytag request %}. Or even simpler - define it with take_context and work with the context there.
https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/#django.template.Library.simple_tag
But I would call it shit code decision - you really should not use it that way because it is really unobvious. Such actions should be done in views.
NR
Valery
You can override dispatch
NR
Valery
smth like that
def dispatch(self, request, *args, **kwargs):
obj = self.get_object()
if obj.smth != self.request.user.smth:
return HttpResponse(status=404)
return super().dispatch(request, *args, **kwargs)
Владимир
Hello, please tell me how to configure django-autocomplete-light?
i hate milk
hello.
i need to implement caching on my site, so i can do it via nginx or django. how will it be more optimized?
Rohan
i hate milk
i mean client side caching
i hate milk
i want to cache static files for optimization
i hate milk
images and css
Hari
How to write test case for if condition
Hari
If not settings.USE_ELASTIC SEARCH
Alex
images and css
You mean besides the caching the browser already does?
i hate milk
yes
Alex
yes
Like caching you would do with redis?
i hate milk
i did not work with redis
Anonymous
i hate milk
its easy
ok, thx. i'll google it
Ansab
How to filter using related name in django
Амантай
Hi everyone. I want to start Django, and first of all I would like to ask what kind video courses would you recommend?(can you share links and so on).
Alex
Амантай
Or is it enough to read the documentation( is it easy to understand )
Амантай
I am ready to buy courses
Амантай
Амантай
Thx
Alex
Ansab do not pm me.
Alex
-_-
Ansab
Владимир
Possibly, better to google django rest framework or even fullstack projects which use react+django rest.
Just a suggestion)
Abdu
https://stackoverflow.com/questions/60263570/pass-checked-items-to-python-using-json
Ram
How do add extra coloumn to the djangos build in auth user table(registration)
I want to add full name to the database
Francisco
please help!!!
Francisco
https://gist.github.com/FFloresM/2f413f68070635a42abb931ebf847ac0
Francisco
Fabian
Hi, does anyone has deployed a dockerized django app on aws?
Please I need a hand if anyone can help me
pratheep
Can anyone help me , how to get the file name that have been selected to upload in HTML file and after pressing upload button in HTML , how should I handle that request in django
Ramziddin
Any way to make a field on admin page readonly?
Alex
PV
Is there any package to create django backup and restore
Anonymous
i have problem with docker
Anonymous
docker version and server version is not the same .How to cope with this problem
Anonymous
Hello,who can help set up Clickuz ? I have problem
Anonymous
Alex
Anonymous
hi to every body Im new to django
I tried to make the django project
I created it and then I made the superuser in my web browser
but I had a problem that when i try to add user or add new group in admin page Isee this error:
no such table: main.auth_user__old
please help meee!!!
Mirco
Anonymous
Anonymous
Did u run migrations ?
I searched it in stackoverflow
and I knew maybe downgrading the mysql version may helps
but i dont know how to do it?
do u know how is it ??
pratheep
Getting” forbidden CSRF verification failed “in django while submitting a file
Mikhail
PV
Mirco
Anonymous
PV
Mirco
yes
If I don't go wrong, it was a bug
Try with postgres
Alex
hey, i need help. I need to change fields in two models and using just one form
Mikhail
Alex
1 form for changing 2 models at same time
Mikhail
you must create view and you form go to vis view
Valery
I have a ticket model with FK to User. I need to return id of ticket for every user start from ticket number one and so on. Now if user1 create ticket he get ticket1. And if user2 create ticket he get ticket2. But I need to save this ticket with number 1 for user2. I think I can override save method and do something like filtering by user and increment tickets count to +1. But I feel this is bad idea. What can I do in this case?
Manik
how to use ModelViewset n its all methods in REST
Alex