SkyLord
Hello Guys
does anyone have working with:
https://github.com/rossp/django-menu
or maybe someone knows something similar
thanks
Денис
SkyLord
I want to realize the menu functionality
BUT
I want the user to enter django-admin to create several menu points, for each menu point to define slug
and then these menu items are displayed on the front
Денис
And edit your menu in Django admin as much as you want
Денис
You can even create a custom template tag with all HTML menu content you want
SkyLord
Thanks
Денис
no working example for you, though. But you gave me an idea, thanks. A nice way of creating a customizable menu
SkyLord
So if we generalize the menu it is the same as the categories ???
Денис
but I can hardly see any reason not to hardcode menu items in html templates.
Денис
Also, you can create a Menu model and a MenuItem model and relate them via ForeignKey.
Then you can create several Menu's with different sets of MenuItems
SkyLord
However, we have for example an application with urls.py in which we define uri. now we create Menu model, and add it in django admin. can we from the admin create a menu and link this menu to an uri from the urls.py file ????
Денис
Денис
I can't explain it in detail, i should first try it myself. No time for this now.
SkyLord
Something like CMS (joomla, wordpress)
I create menu, then create article and link this menu to article
SkyLord
Ok, thanks
Денис
Денис
or Wagtail
Anonymous
https://dpaste.de/NT42
Claudio
Hi everyone, i have a question:
If i have two models: A, B
A has a many to many relation with B
So if i type a.b.all() I get all b objects, that's why it is needed to use a Prefetch object
If B has a many to many relation back to A, can I count all the A objects of a B object of A?
For now i can do (pseudo code):
A.prefetch(B).annotate(Count: 'a_count', 'B__A') but the count goes inside the first A object, not in the B one
I want to be able to do A.B.a_count
Claudio
Okay, I did it
If someone needs the solution is to override the queryset on the prefetch object, and attach there a count annotation, example:
objects = Prefetch("b", queryset=B.objects.annotate(a_count=Count('a'))
Shikhar
Guys I'm having some problems while designing the site. I'm trying to put image, title and content in a card but it's not working. Need help
Денис
Shikhar
Денис
No access to dpaste.de for me
Денис
I'm using the same feature
If you need help rather than just someone to talk then just provide your code via pastebin or something.
But remember that this is not a Django-specific question and we don’t necessarily bother solving it.
Kumar
Hey, what is slug in Django?
Kumar
When we should use it?
Kumar
I'm trying to write unit test for models, came across this term..
Muflone
Hey, what is slug in Django?
A field with numbers, characters and dashes only.
It's what you would use for a webpage.
BTW the Django documentation explains it better
Kumar
Okk, thanks...
Kumar
I'll give a read to docs...
Anonymous
Rahulraj
Hi
Rahulraj
Any one have an example implementation of a bootstrap carousel with django
Rahulraj
Its working with static files
Rahulraj
But when i try to do with dynamic loading its not working
Tommaso
Hi, I am developing an app in Django.
I have built an app that allows my users to upload large amount of data, as they were copiling many forms per time..
In particular, I am allowing them to download a template (excel sheet) with indications on how to compile it correctly and upload it.
Now I want my app to read these files, extract data from the excel sheets and store it into another model that I have already prepared.
Can you please point me a tutorial or a resource expaining how to do it?
Anonymous
How can i hide my password from django setting . i put it in there for forget password option to send the password for the user , yet i want it to not seen like string
Muflone
Anonymous
why the user must get a chance to recover thier password
Anonymous
what i did is to reset password it need the emaila and password to send the reset message to the user by email but when i put my email and password in my code to send by my emailmy password is visible bcos i put it like string there
Anonymous
Muflone
You don't need any password to reset it, just invent a new password and send it to the user email
Anonymous
ya now u r close to understand me to send an email it needs an email who send it the reciever
now what i need is the sender ( email who send the rest password message to the user email) must put password in django setting isnt it ?
Muflone
You mean the smtp password? Not the user password
Anonymous
yes
Muflone
If you don't want to write your smtp password the only choice is to use a service that enables you to send email like sendgrid
Muflone
Or use the internal mail server, if the hosting server has one
Bernard Kwey
How can I change my database by default to MySQL
Sencer
After you changed setting file and you have dumped data, you can restore it by loaddata
Bernard Kwey
Thanks
Alek
Hello everyone, please advise the tutorial on how to register with sending an email message? (I use vps on reg.ru)
Shikhar
How to show image in template whose url is stored in database
Rainur
<img src= "{{image.url}}"
Денис
Денис
depends on whether full or partial URL is stored, though
Shikhar
Shikhar
Like .jpg
S
Anyone worked on Django captcha ?
Anonymous
Hi guys, how can I set columns names in intermediate many to many table?
Anonymous
Only create separate model?
Anonymous
Денис
If you don’t specify an explicit through model, there is still an implicit through model class you can use to directly access the table created to hold the association. It has three fields to link the models.
So a separate model is created no matter how you define ManyToManyField.
Anonymous
Also what if I dont wanna to create id filed on intermediate table, is there a way of doing that?
Денис
Ram
What’s the difference between generics.ListApiView, APIView, viewsets and there are few others modules to inherit for class based views. I don’t get the difference. Can someone tell me about that?
Willie
Hello experts, is anyone using virtual environment Django in python 3.8 ?
Angel
hi guy's i try to do a search bar, can you help me with some documentations
Angel
i was try to do it with ajax but i was find library q wich is better option
Angel
??
Eddie
Guys i need help