Two list on one page

18 views
Skip to first unread message

Matheus Bon

unread,
Aug 24, 2022, 3:33:23 PM8/24/22
to Django users
Hello There

I want to create two lists on one page, in the style of the image (I'm Brazilian, so the list is in Portuguese).

However, if I do it the way I'm showing it in the code image, I'll necessarily have to make two pages for each list, right?


Screenshot from 2022-08-24 16-28-58.png
Screenshot from 2022-08-24 16-31-45.png

Matheus Bon

unread,
Aug 24, 2022, 3:34:41 PM8/24/22
to Django users
What would be a way to get two lists on the same page?

Thomas Lockhart

unread,
Aug 24, 2022, 3:50:44 PM8/24/22
to django...@googlegroups.com
Lay out your template to include both lists, then define get_context_data() in your view to have two lists of objects to show in your template.

Get farther along and it will be easier for us to answer specific questions.

hth

- Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05b14e53-1950-41ac-84ac-51800f40a7e2n%40googlegroups.com.

Ezequias Santos

unread,
Aug 24, 2022, 6:03:30 PM8/24/22
to django...@googlegroups.com
Hello @Matheus

apparently, you have this:
product list.
expense list.

I don't understand why you want this all on the page, since it deals with a different cost center. (just a suggestion)

Regarding pagination, if you're using Django and I think so, have a look at this: https://docs.djangoproject.com/en/4.1/topics/pagination/

I think it can help you a lot, here you have everything you need.

by  Ezequias

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages