Django select and delete posts [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am making a blog based on Django on guides. I have a list of posts that you can change and delete. How to make it possible to select multiple posts and delete? I don't even know which side to approach the problem. All i need is are ways to complete this problem. I want to complete it by myself, but i need some advices about the ways how to do it

there are lots of way to do that and it's usually a combination of frontend and backend, but in Django side you can filter rows (with lets say ids) and bulk delete them like this:
Post.objects.filter(id__in=(1, 2, 3, ...)).delete()
in frontend you should figure out a way to pass ids you want as a list to your Django view/api.

Related

How to show history of customer's orders in restaurnant ordering system [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
I am working on a project of making restaurant ordering system using basic concepts of python. I need to put a logic to store every ordered item of customer and show his order history.
I am beginner at programming so, i not able to think of a logic yet. Please help
How about a Person class that has a variable of type list named orders.
Now you can append the orders list with an item if a person orders something.

Display image in dropdown list in django [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm currently working on a project and my task is to build a feature for users to rate different countries in a dropdown list.
How to add a flag beside the name of the country in drop downlist?
The easiest solution is probably to add the corresponding flag emojis to your country names.
If that doesn't fit your requirements, you will have to integrate a JavaScript library, e.g. jQuery UI.

how to make django tempory list? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to know that is it have way to make a tempory list that it can add by input field and not save to server until click some button like add to cart button. I will use this for POS system.!
[example similar to this]
(https://i.stack.imgur.com/wEvKf.jpg)
Django comes with Form Wizard which might helps you.
You can use sessions or cookies to store data, both methods have a default WizardView that takes care of storing the data for you.

When to use a tuple vs list vs dictionary in python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I was having a discussion with a friend on Facebook today and he's just starting to learn python, as we were discussing he said this,
"I've written a million lines of code over the years and the whole idea of when to use a tuple vs list vs dictionary in python is just vague"
and I am having the exact same issue. Then I suggested he post here with questions and it dawned on me. . . Why don't I POST the question? Since it's a big block for me as well.
So programming nerds. In plain english, how would you best answer this? P.S. I love this website.
Use a tuple to store a sequence of items that will not change.
Use a list to store a sequence of items that may change.
Use a dict when you want to associate pairs of two items.

How can I create a client side database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I create a client side database to store information of users on client side. Does anybody know of any tutorials or pointers? Which is the recommended database to use? My client is in .js and uses Django framework.
What you are asking for is called Web Storage and is part of HTML5.
http://diveintohtml5.info/storage.html
http://www.gwtproject.org/doc/latest/DevGuideHtml5Storage.html
However, many times when people SAY they need a client-side database, I ask them the details and it turns out that they don't really need client side storage at all, so proceed with caution.

Categories

Resources