Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to create a form in flask such way that i can upload image and put name of image and select location of image from my db and then display all images from that place and can select some images and can write their data in db.

something like that https://drive.google.com/file/d/0ByF5SjLL_-yUWGRQeW9zTktqTk0/edit?usp=sharing

share|improve this question

put on hold as too broad by Martijn Pieters, Burhan Khalid, davidism, Ffisegydd, Zero Piraeus Sep 3 at 15:43

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Can you share the code you already have? –  Lovato Sep 3 at 11:19
    
def add_featured_places(): form = ImageUploadForm(request.form) sql = "SELECT name FROM places WHERE place_type='city'" place =get_mysql_data(sql) form.select.choices = [(places['name'], places['name']) for places in place] print form.select.choices.data return render_template('/views/admin/featured/add_featured_places.html', form=form) class ImageUploadForm(Form): file = FileField("UploadImage") name = TextField("Name", [validators.Required("Please enter name of Image")]) select = SelectField("City") –  jayprakashstar Sep 3 at 11:22
    
Ok. This is a function where you perform the query. Do you have flask code to share? –  Lovato Sep 3 at 11:23
    
<form action="upload" method="post" enctype="multipart/form-data"> {{form.file.label}} {{form.file }} <br/> {{form.name.label}} {{form.name }} <br/> {{form.select.label}} {{form.select }} <br/> {% for x in data %}<div class="img"><a href={{x["photo_url"]}} ><img src= {{x["photo_file_url"]}} ></a> </div>{% endfor %}</form> –  jayprakashstar Sep 3 at 11:24
    
@Lovato you can see image i have attached . I can integrate code if i can get idea or utline of code –  jayprakashstar Sep 3 at 11:25

Browse other questions tagged or ask your own question.