Python + Django list + HTML select option

Asked

Viewed 232 times

0

Good morning guys,

I need your help with a code I’m developing in python + Django

Here’s my problem: I have a function in views.py in which you select a Name in the client table and place the data(fetchall()) inside a list, and send this list via template to the view HTML page.

On the HTML page, I get the list via template and for each row of the list, I display an option with the value of the line in value and in the option view name itself

However, instead of only the customer’s name appearing Client Shows up full of dirt from the list ('Client', )

I have tried to replace when receiving, but it is no longer a list and displays everything in one line I have tried to send several templates dynamically, but there is no way to receive them dynamically also in HTML

If you can give me some idea that can solve this problem of mine, I would be very grateful.

  • This makes it difficult to help you, ideally put fragments of your code and point out where it is, specifically the problem. You know the context, those who read the question don’t.

  • Add the code you’re using to see what the problem is..

  • About this part: 1 - "However, instead of appearing only the client name Client Appears full of filth from the list ('Customer', )" 2 - What would that result be? 3 - How is this customer list looking for this information? I would like to help if I could clarify those parts.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.