Ghorz
Ghorz
I don't want to learn js
Mirco
myii
So for Django Admin, you append the transpiled js files to class Media.
Ghorz
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
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).
Mirco
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?
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
Fedor
Why?
Fedor
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
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.
Ghorz
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?
Mirco
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.
Nitesh
Mirco
Mirco
Maybe popovers are a better choice and obviously the image is being passed by Django
Mirco
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) 🇳🇴
Ill poste the code in a bit... first some play with my doughter... Thanks
Mirco
Anders (izzno / gooood) 🇳🇴
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.
Mirco
Anonymous
godmode
How do yo do It ti access to a query from a queryset un the template? {{posts.0}}?
Mirco
godmode
And don't wanna make for
cj
godmode
Cuz i hoy ando html with several sections
cj
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
cj
godmode
10 minutes to write something...
cj
godmode