Alex
SomeBody
https://monosnap.com/file/3UHbYtZbgaHQcFKQ3Yy0R6cqUcdOSt
https://monosnap.com/file/NMVbwTxLbblc73kBPCGJ93GzAxQ5Rc
hello, i have querySet with annotate fields(likes and count_comment).
How I can serialize this fields?
Mirco
SomeBody
Mirco
SomeBody
Ok, thx
Mirco
likes = serializers.IntegerField()
count_comments = serializers.IntegerField()
Mirco
And DRF should not throw errors again about model fields
SomeBody
https://monosnap.com/file/FWobhTHbl3APtxMGwMEBL6GBPABMOT
again...
SomeBody
thx very much <3
Mirco
Is it working now ? 🙂
SomeBody
yes!!
Mirco
😎😎
SomeBody
mb you know how i can serializer django-imagekit fileds?)
SomeBody
okey, thx u
Mirco
okey, thx u
They are files so in serializer you can return the media URL to them
Alkaif
How can I add the dynamic value in django-paypal payment
Mirco
AL
I'm trying to populate this dropdown list Check Merge Options with the orders which I get from calling this method find_merge_targets() (which is defined in the models.py inside the PrepOrder model) in the models.py
But I'm not getting anything populated inside this dropdown, why is that? can anyone please take a look at my code and tell me where I'm getting it wrong?
AAYUSH
Can i get some help in Add to cart functionalities ????
Doragonsureiyā
AAYUSH
karakurt
HamidReza Fekri
Hello have you ever use pyotp???
Rijil
Rijil
It's a prebuilt ecommerce site built on django
Rijil
You can customise it for your use
Dana
Hello! Could you help me solve this problem please? When I get data from database, fields displayed None
Dana
how i can solve it
Dana
bookcrossing.Author.None; bookcrossing.Condition.None
Doragonsureiyā
Hello! Could you help me solve this problem please? When I get data from database, fields displayed None
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase
Dana
I crated Models then Forms; for example bookname = models.CharField(max_length=100) ; genre = models.ManyToManyField(Genre, verbose_name="жанры") , but when I try to display this genre on my html, with code class BooksView(Genre,View):
def get(self, request):
books = BookUpload.objects.all()
return render(request, "bookcrossing/books.html", {"books":books}) bookname are displayed, but genre not ,
Alex
Dana
{% for book in books %}
<div class="card_item" >
<div class="card_img" >
<img src="{{ book.image.url }}" alt="" width="180px" height="270px">
</div>
<h1 class="card_title" >{{book.bookname}}</h1>
<p class="card_subtitle"> {{book.author}}</p>
<div class="card_footer" >
<p class="card_price" >{{book.price}} ТГ</p>
<p class="card_address" "><a href="books/{{book.slug}}">Read More</a></p>
</div>
<div class="like" > <img src="{% static 'css/like.svg' %}" alt="">
</div>
</div>
{% endfor %}
Dana
bookname, price are displayed, but m2m fields are not
Artyom
Artyom
Like this:
print("Hello World")
Alex
Tuấn
Please, help me.
Tuấn
I try "CORS_ORIGIN_WHITELIST = ['xxx.com]" but still error
Bekhruz
Tuấn
?
I added in settings "CORS_ORIGIN_WHITELIST = ['xxx.com']"
Tuấn
error "Origin checking failed - https://xxx.com does not match any trusted origins."
Tuấn
Tuấn
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
Dana
How to solve problem "Enter a list of values." in form? but my fields are not connected with m2m
Hrutuja
Hello everyone,please help me
Hrutuja
I'm making the Django app and need parsing some data from the UDP socket.what can help me handle UDP socket very easy, when I embed it to Django project, it doesn't run. how to embed it to Django?
Hrutuja
Please suggest any way or if have any tutorials
Pedro
#Question Django:
hello
there is a structure: car brand->model range
toyota:
--Camry
--corolla
--cruiser
Nissan:
--beetle
-- qashqai
--tiana
need form 2 field ModelChoiceField . The first selects the brand, the second displays only those models that match the selected brand.
for example, when choosing "Toyota" in the first field, in the second one there should be a choice only from [Camry, corolla, Cruiser]
(on auto.drom.ru - how it should work)
I'm sure nothing complicated, but the second day I can not google the solution.
Thanks
Rasul
Pedro
Matuo
Hi gusy, guys when i want update my user profile picture, and send image for my view in if form.is_valid():
Matuo
give me this error:
expected str, bytes or os.PathLike object, not ImageFieldFile
Javlonbek Torajonov
Who know django model translation
Doragonsureiyā
Who know django model translation
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
shiva
How to filter data in sqlalchemy
shiva
Anyone
Doragonsureiyā
Anyone
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work.
Have a nice day 😊
Rohan
shiva
I have to filter and delete that data from the table
Rohan
shiva
Doragonsureiyā
Tuấn
error "Origin checking failed - https://server.com does not match any trusted origins."
Prashant
Guys , I'm getting ajax not defined error in dependent select in script and views.py
Can anyone pl tell how to solve the ajax not defined error
waran
after execution Source doesn't exist what's the problem .....?
Doragonsureiyā
waran
My html file not displaying that problem given the TEMPLATE DON'T EXIST
D
Place the template folder in root folder..and add [BASE_DIR, 'templates'] in settings.py
AK
Any good tutorials for learning django rest framework completely?
Mirco