forms - python flask ImmutableMultiDict -


यह मेरा कोड है:

  @ user_bp.route ('/ band', methods = ['GET', 'POST']) def band_details (): include.form.User आयात से Banddetails form = Banddetails () अगर request.method == 'POST' और form.validate_on_submit (): pippo = request.args पीटा में आइटम के लिए प्रिंट सूची '' [[[[[[[[] '') प्रिंट 'सेईटोटो दी क्वि' + स्ट्र (लेन (पिपो)): प्रिंट आइटम रिटर्न "रिजल्ट" रिटर्न रेडर_टामप्लेट ("banddetails.html", form = form, session = सत्र)   

मेरे पास एक समान रूप है:

  & lt; इनपुट प्रकार = "टेक्स्ट" नाम = "नाम []" id = "name" मान = "" & gt;   

मुझे तत्व नाम [] , अंतिम नाम [] प्राप्त करना चाहते हैं, लेकिन मैं वर्णित प्रक्रिया को नहीं समझता फ्लास्क एपीआई में।

यदि आप एक HTTP POST विधि का उपयोग कर रहे हैं तो आपको इस तरह से पैरामीटर प्राप्त करना होगा:

  pippo = request.form.getlist ('name []')   

यदि आप HTTP GET विधि का उपयोग करते हैं, तो ऐसा करें:

  pippo = request.args.getlist ('name []')   

डॉक्स की जांच करें।

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -