Anonymous
create an Category for Product and show the product of last child of category http://example.com/category/slug/slug
LB (Ben)
create an Category for Product and show the product of last child of category http://example.com/category/slug/slug
Note. Probably better to keep replying on the original thread.
Anyway - if you haven't already, I recommend you read the docs in full.
https://django-treebeard.readthedocs.io/en/latest/api.html
Create a Category
new_category = Category.get_root().add_child(name='foo', slug='foo')
not sure on your product model, but assuming you have a foreign key to your Category model, you can then create the Product with a reference to the Category.
Show Products in the last child of Category
Products = Category.get(slug='some-parent').first().get_last_child().products
Anonymous
Harry gorilla
Why is django loved over other python web frameworks?
Anshu
Yousef
Hello
Please help me to solve my problem,
I installed Django on pycharm, but when i write 'python manage.py runserver', had this 👇 error
python: can not open file 'manage.py': [Errno 2] No such file or directory.
I tried to change location of my made file 'djangoProject', but that error is occured
Azamat
Anonymous
I want to use redis as db to handle shopping cart ,have a doc about it?
Alireza
Shukurillo
from django import forms
class NameForm(forms.Form):
your_name = forms.CharField(label='Your name', max_length=100)
In the situation above, should I create a model for the form?
Shakthi
👑 Dharmzeey
Good Evening Everyone.
Please I need help with my code.
I am trying to access an attribute of a ForeignKey from a model which I imported.
Please how can I access it.
Tho I can access it with the dot (.) operator in the shell Terminal
But I want to be able to access it in my Editor and assign it a value.
Below is the pasteBin
👑 Dharmzeey
https://pastebin.com/anKW1gPQ
Dot enum
I need help in simple_history package
Nenavath BADYA
Good evening my friends, I had completed MCA in 2011, now I am preparing django software developer . Friends anyone give me a suggestion I have a chance to join in IT sector.
Maxim
Nenavath BADYA
It is possible please help me any ones.
Nenavath BADYA
Dear I want to put six years experience
Dot enum
ask specific question
I'm not able to get changed by username from history, when edit is being made from frontend but it's happening when it's being changed or created from django admin
Mark
Hi, can i ask some lammer questions?
Mark
I would like to make a model for keeping geographic coordinates. Which in the administrative panel would work as a search bar with an interactive map and placemark. In minimal style keep only latitude and longitude, in advanced style full address if available. The whole garter to openstreetmap. In general, I am worried about how to make a search string that would send GET requests to openstreammap
👑 Dharmzeey
👑 Dharmzeey
Thanks everybody
pavan
Hello All, Iam working on a Python django project on Excel sheet.I want some help.
pavan
I had given an edit button for each row if I click on it, it manipulate the thing in the particular row but it didn't works.Instead it opens new row.
Fan / Ac
i have a tcp server which is always open and i need to display the data received on the server on django app, whats a good way to do this, i can do db insert on tcp server and db retrieve on django app
what are the other ways ??
confused about how should i send data, should i post data to django app and store it in session and display
or make a get api on tcp server and send data on get request
Haha
I need to learn about ACL scripts ..
Can anyone help me with suitable resources?
遠遠
Hello, how to update multiple fields via Model.objects.bulk_create(list)
Mirco
Sr
Hello.. is there anyone knows how to built expense tracker app using django
Sr
Please help me in building expense tracker app
QAM
Hi,
Any hint to make date availabilty module in django for tour or any service
LB (Ben)
Hello.. is there anyone knows how to built expense tracker app using django
Best to do a bit of searching first, there are many Expenses apps built with Django already out there + also tutorials.
- https://django-expense.readthedocs.io/en/latest/
- https://christosstath10.medium.com/django-expenses-7dfd8fb13fc9
- https://kristian-roopnarine.medium.com/creating-a-budget-web-app-with-django-655369b6d43c
- https://github.com/rishank-shah/Income-Expense-Tracker
- https://github.com/MicroPyramid/micro-finance
Fan / Ac
whats the way to call an api from a view when both api and view exist in the same app other than by using request
arun.krg
Django admin asks for login after every click , idk how to fix this
Doragonsureiyā
Абдулазизов
Hello
Абдулазизов
I need internalization in my blog website. I am having some problem in django model tranlation can someone recommend me something like django model translation that should translate static files too
Абдулазизов
Thanks for your answer ahead
#help
Mohammadreza
Hi everyone
Is it possible to use djongo in integration with elasticsearch?
Healer
Guys what is the advantage of django over flask, aside from the battery included.
Healer
Mirco
Rebellion
Exception Type: IntegrityError
Exception Value: UNIQUE constraint failed
This is the error I'm getting while posting a comment on a blog. User can post only one comment. If he tries to post another comment even on any other blog post, this error occurs.
How, I can solve this error? How can one user post comments on multiple blogs..?
Thank You..!
Rebellion
models.py
class Comment(Model):
commenter = ForeignKey(Profile, on_delete=CASCADE)
post = ForeignKey(Post, on_delete=CASCADE)
Rebellion
Rebellion
Rebellion
pls help here....😕
fateme
fateme
fateme
Domain
Hello guys please I'm having some issues understanding something in Django rest framework
Domain
I have a list of users called users_list, I'm trying to iterate over the list and return each user but it doesn't work
Domain
It only returns one user
Domain
Isn't it possible to return all the users?
Ahmet
Domain
I wrote the user_list myself
Domain
Something like
user_list = [ {"name" : "John", "age" : 12}, {"name" : "James", "age" : 13}]
Domain
Then I try to iterate through the list of dictionaries and return each individual element
Mohamad Reza
Show your code!
Kamronbek
Kamronbek
First show your code, and tell what do you want to do clearly with that code
Mister
Hello everyone.
Mister
I have an error in my Django code
Mister
I send a code
Mister
thanks
Doragonsureiyā
I send a code
To share code or error tracebacks, use a pasting service, like:
- https://linkode.org
- https://dpaste.org