Anonymous
How to write custom decorator
Muflone
How to find answers without a search engine?
cj
🤣
Anonymous
Links for creating a Custom Django User Model please
cj
Anonymous
isn't your Google working, sir?
I have googled and watched a lot of tutorial but i was guessing that may be some of y'all can recommend best blog or post about that
Anyway thanks ☺️☺️
cj
cj
nvm, take a look to: https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html (old but still gold)
Anonymous
🙏 thanks 😊
Felipe
Hey guys! Whats up?
Felipe
I'm with a little problem here
JZA
ctrl-alt-supr
Felipe
I created a field in the model that can only accept values between 0 and 100.
To validate the input I created a validators.py file that checks if the number entered is within this range.
By testing manually, by the admin, the validators are raising the ValidationError, but when trying to simulate the behavior in the automated tests it is not raising.
Felipe
Here's the code
Felipe
https://pastebin.com/2d4gMQWq
Felipe
Someone can help me to understand what I'm doing wrong?
Dmitrii
Felipe
Thank you @dkovner
Felipe
It works on admin level, but not at db level. This is why the test is failing
Felipe
I'll try to change my approach
Dmitrii
u r welcome
Akash
is there any inbuilt way in django to get queryset count in K or M format if it's a big number?
10K instead of 10000
Anonymous
Mohmadhaider
How to build bot on WhatsApp
RIZWAN
+1
Mirco
Raghad
If any one know how to make test in django ??
Yegor
Yegor
Just google it
Raghad
Ok thanks
Mirco
iNcAeLuM
Hi, I am trying to display a img depending of a filed of an objects, am trying to do this:
{% for i in objects %}
<img src="{% static 'myapp/images/{{ i.field }}.jpg' %}" alt="">
iNcAeLuM
no result
iNcAeLuM
any way to do this
iNcAeLuM
?
Anonymous
iNcAeLuM
iNcAeLuM
iNcAeLuM
should i do :
<img src="{{ i.field.url }}.jpg" alt="">
Anonymous
iNcAeLuM
iNcAeLuM
is field ImageField()?
is a charfield and i want to display a img depending of the name of the charfield
Anonymous
oh I see
Anonymous
then you have to make <img src="{{ MEDIA_URL }}{{ i.field }}.jpg" alt=""> just pass MEDIA_URL in your render context
iNcAeLuM
Anonymous
iNcAeLuM
Anonymous
H
Can someone provide me with django 2.2 books or tutorials
Yegor
Bhupesh
Hey guys what is the best way to update M2M fields though views ?
Mohmadhaider
Gupshup.io
Goutham
Hello how to pass queryset to template please help
inchidi
inchidi
that dictionary you return with your response on your views
cj
Macurrent
How is apache important for django users?
George
Yegor
Bernard Kwey
please can someone help me with the how i can really create a comment template i tried the django documentations but i couldn't get my head around it.
Anonymous
Hey
Anonymous
M new here
Anonymous
Actually m beginner in Python
Anonymous
Could u guys plz guide me
Mirco
Maz
Actually m beginner in Python
Tell you what...work with Python only for a month.
And I mean REALLY work on it.
Then come back and we'll give you pointers on Django.
Anonymous
أمجد☄
How can i add an expiration date function in a model that takes value from a multiple choices field for ex: 10 days, and when the date expires it would do some kind of action like turning a boolean into True ?
Mirco
Mirco
Mirco
Look for async task ( celery or django-q ) and python property into models
أمجد☄
Okay, thank you