jquery

Using jquery POST request to save form in django

Using jquery POST request to save form in django Question: here my form.html in this form I’m use Django model form. <div class="container"> <form action="{% url ‘add_product’ %}" id="product_form" method="POST" enctype="multipart/form-data"> {% csrf_token %} <div class="row"> <div class="col-sm-12"> <label for="">{{form.code.label}} :</label> {{form.code}} <span id="error">{{form.code.errors | striptags }}</span> </div> <div class="col-sm-12"> <label for="">{{form.company_id.label}} :</label> {{form.company_id}} <span …

Total answers: 2

Jquery Validation remote method always shows invalid

Jquery Validation remote method always shows invalid Question: I am trying to validate an html function with django and the JavaScript FormValidation plugin. I want validation to check if the inserted email already exists, This is my validation remote email: { validators: { notEmpty: { message: ’email field can not be empty’ }, emailAddress: { …

Total answers: 1

Unable to handle click events for individual buttons

Unable to handle click events for individual buttons Question: What I want to do: I have two buttons in my html client. I want to handle button click events on the server side using two different and separate event-handler functions. I will click any button, and upon clicking, the client will send a text message …

Total answers: 1

how ManyToManyField works?

how ManyToManyField works? Question: i made a genre field for my model in a music project ,i could use ForeignKey too pick genres in create section ,but in order to add another part(genres list) to site i used manytomany field since it works reverse ,i thought maybe i can add a genres part that when …

Total answers: 1

How to group by and get latest record in group contain all of fields in Django?

How to group by and get latest record in group contain all of fields in Django? Question: Imagine we have a table like this: id name type created_at 1 James male 2022-03-02 2 Jane female 2022-04-02 3 Kirk male 2022-03-04 4 Sarah female 2022-04-04 5 Jason male 2022-03-05 And i want to group by type …

Total answers: 2

Returning two arrays from a python script in Django and utilizing in Ajax simultaneously

Returning two arrays from a python script in Django and utilizing in Ajax simultaneously Question: I have a python script running in views.py within Django which returns two very large string arrays, x and y. It currently is able to run off a button press within my index.html. def python_file(request): final() return HttpResponse("ran") The ajax …

Total answers: 2

Mute/unmute iframe video from another domain

Mute/unmute iframe video from another domain Question: I’ve implemented an iframe inside my webpage, the iframe points to another domain to catch the video content. Nothing fancy inside my webpage, the iframe is standard aswell: <iframe id=’frame’ src=’domain.com/stream/324/index.m3u8′ width=’100%’ allow=’autoplay; encrypted media’ frameborder=’0′ allowfullscreen></iframe> I would like to add buttons outside the iframe to mute …

Total answers: 1

Sending data asynchronously from Flask to Front-end

Sending data asynchronously from Flask to Front-end Question: I have a DNA scanning tool. I want to send and receive data asynchronously. After every action in Flask, I want to send data to the front-end which will tell the user what is happening. Here is my code: FLASK: @app.route(‘/upload’, methods = [‘GET’,’POST’]) def upload(): if …

Total answers: 1

How to scrape from a Jquery table using Python

How to scrape from a Jquery table using Python Question: I am trying to scrape the first ten items from this website. I am using Python Selenium/BeautifulSoup. It seems the table is loading using some jquery script. I am honestly stumped where to start as the tutorials and guides aren’t matching up with this website. …

Total answers: 2