Ghorz
Javascript's Fetch APIs and you will ready to go 😁
But I dont have a clue of Javascript. Only python 100%
Ghorz
I don't want to learn js
Mirco
But I dont have a clue of Javascript. Only python 100%
You should if u want to make dynamic front ends
myii
So for Django Admin, you append the transpiled js files to class Media.
myii
# Define alias for jQuery `$` (in this case `grp.jQuery`) __pragma__('alias', 'S', 'grp.jQuery')
myii
Notice, I had to use S and not $.
myii
With Django Grappelli, BTW.
Happy
yes
Can you share the save() code? def save(self,*args, **kwargs) This may solve the problem.
Anonymous
looking for getting your error fixed in django or if you want to have your whole website/blog or web application build from scratch check out my services and price at my Fiverr profile .please do have a look https://www.fiverr.com/ankitsaxena07/build-website-using-django-and-python?ref_ctx_id=1e1ef446-2e2b-4481-bfc8-8eb8a37f0e18
N S
How do i print a list in django templates? ?
Arulmurugan
{% for item in a_list %} {{ item }} {% endfor %}
Rainur
Hello! I am new to Django. I make a website for taking courses. Need to store pictures. I heard that for this you need to organize a certain folder structure so that pictures load faster. Please tell me what I need to study. Thank you in advance!
Anonymous
Have anyone tried the django cms
Anonymous
I facing the database error in django-cms
Anonymous
It's showing something g table error
Anonymous
Please help someone
Fedor
Does anyone know whether it is possible to pop element from database? I mean get last (or first) one and delete it (immediately using ONLY one query).
Fedor
How?
Mirco
How?
Django orm has .last() and .first()
Fedor
Yeah i know that, but what if i used it with delete(). Would not it make 2 queries?
Mirco
Yeah i know that, but what if i used it with delete(). Would not it make 2 queries?
If u use django debug toolbar for development you can see how many queries Django does into your view 😁
Oleg
Why are you worried about making 2 queries instead of 1? Do you mean to avoid race conditions?
Oleg
I'm not very experienced on the topic, but there is this method, which should lock selected rows for you to delete them: https://docs.djangoproject.com/en/2.2/ref/models/querysets/#select-for-update
Fedor
I dont wanna make extra queries to db
Oleg
I dont wanna make extra queries to db
Sounds like premature optimization :)
Fedor
Why?
Oleg
Why?
Well, you won't gain much by reducing two queries to one. Unless you're deleting many of these rows at once, but in this case you should probably delete them all in one query instead of one by one.
Maksym
Error 500 is a very general one, without reading the logs you won't find out what happened
probably, that is because i am using whitenoise. could it be the problem?
Ghorz
myii
I'll learn it
That's an extension for Django Admin. My point was that the jQuery example I gave was based upon how Grappelli uses jQuery. You may need to do it slightly differently with standard Django, I haven't checked.
Nitesh
I'm using diffrerent forms in different createviews different urls but using same model and I want to insert data sending by these different forms in a single row but they are inserting in different rows.
Nitesh
https://dpaste.de/z2Yb
Nitesh
four forms creating four different rows in db
:)
Hy guys i want to work on any open source django project please let me know if you have any idea about it
:)
/
Anders (izzno / gooood) 🇳🇴
Hi guys, i need a hint. I want an image to pop-up in a dialogbox like ahref's title= or something simulare... Doen anyone have a good suggestion?
Anders (izzno / gooood) 🇳🇴
Use modals
I want it to pop up to the right of the link the mouse is hovering, It's a huge table with products so when you move your mouse down the column i want the images to generate to the right. I was thinking more like this: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_popup without the click
Anders (izzno / gooood) 🇳🇴
^ is a possibility, but maybe theres a npm package or a better way.
Anders (izzno / gooood) 🇳🇴
I could modify this to popup to the right on hover.
Anders (izzno / gooood) 🇳🇴
https://imgur.com/rH2DETM To give you a better idea, when you hover over "super duper" or "uber duber" an image should pop up to the right.
Mirco
Maybe popovers are a better choice and obviously the image is being passed by Django
Anders (izzno / gooood) 🇳🇴
Maybe popovers are a better choice and obviously the image is being passed by Django
Thanks, I'll look in to that when I get home 👍. Four eyes (and experience) is better than two 😁
Anonymous
Can anyone try django cms
Anonymous
I am facing error please help
N S
How to display options using an array in django templates
N S
I am having this error can anyone tell me why this happpens
N S
https://dpaste.de/ZMA1
Anders (izzno / gooood) 🇳🇴
😎😎 eight because I wear glasses 😝
My Man! ;) https://imgur.com/6YRGstA
Anders (izzno / gooood) 🇳🇴
Ill poste the code in a bit... first some play with my doughter... Thanks
Anders (izzno / gooood) 🇳🇴
Hi guys, i need a hint. I want an image to pop-up in a dialogbox like ahref's title= or something simulare... Doen anyone have a good suggestion?
This was the the best solution as I am allreaduy using Bootstrap: https://pastebin.com/rGXKfD4y Thanks ;)
Ghorz
Hello people. consider this. Model.objects.filter(pk=pk) Let's say there are n objects in the table. How do I retrieve object pk-1, pk+1. That is objects to left and right of retrieved object. Pk should not be used. Please help.
Anonymous
Hello people. consider this. Model.objects.filter(pk=pk) Let's say there are n objects in the table. How do I retrieve object pk-1, pk+1. That is objects to left and right of retrieved object. Pk should not be used. Please help.
You'll want window functions. See an example here: http://sqlfiddle.com/#!15/9fd7a/8 Django 2.0 supports Lag() and Lead() https://docs.djangoproject.com/en/2.0/ref/models/database-functions/#window-functions
godmode
How do yo do It ti access to a query from a queryset un the template? {{posts.0}}?
godmode
And don't wanna make for
godmode
Cuz i hoy ando html with several sections
godmode
My queryset return me 5 post , and i hoy a section with 2 another with 1 and the last one with 2
godmode
It's not my template, so i need to access to this post_list individual
godmode
what do you mean with "hoy"?
Got* i'm spanish and my keyboard is not un english, it's a pain in the ass
cj
It's not my template, so i need to access to this post_list individual
how can't it be not your template? if you own the django project, you own the template too, unless you're making an API 🤔 which isn't the case according to your words
godmode
10 minutes to write something...
godmode
do to @DjangoEsp
No thanks, i don't get on well with them, hold on