[Flask] Unpacking python list

Corey Boyle coreybrett at gmail.com
Fri Apr 22 11:32:36 EDT 2016


Is "list" a list with a single set of strings in it, or is "list" a
list that contains lists that contain strings? (probably not the
clearest question)

On Fri, Apr 22, 2016 at 11:09 AM, Mazzei, Stephen Andrew
<Stephen.Mazzei at asrcfederal.com> wrote:
> Good morning,
>
>
>
> I have some back end python code pulling from a database generating the
> following list:
>
> ['Stephen Mazzei', 'cv7457', 'mazzei.s', 'non-employee', None,
> 'Stephen.Mazzei at asrcfederal.com', 'ASRC Federal Data Solutions', None,
> 'BECKETT RIDGE TECHNICAL CENTER', 'USA', 'HPC', 0, 10L, '10.0', '02/16/2016
> 09:22 AM', 'unlocked']
>
>
>
> I then have in the jinja/html page a
>
> {% for item in list %}
>
>     <p> {{item}} </p>
>
> {% endfor %}
>
>
>
> This generates the following on the HTML page
>
> Stephen Mazzei
>
> cv7457
>
> mazzei.s
>
> non-employee
>
> None
>
> Stephen.Mazzei at asrcfederal.com
>
> ASRC Federal Data Solutions
>
> None
>
> BECKETT RIDGE TECHNICAL CENTER
>
> USA
>
> HPC
>
> 0
>
> 10
>
> 10.0
>
> 02/16/2016 09:22 AM
>
> unlocked
>
>
>
> In all the other pages I have written, I have been to do
>
> {% for item1, item2, item3, etc…., item16 in list %}
>
>
>
> And then use the values as needed in the templates. For some reason when
> doing this on this one page, I receive the error:
>
> ValueError: need more than 14 values to unpack
>
>
>
> If I take off the last two values it still errors but with
>
> ValueError: need more than 6 values to unpack
>
>
>
>
>
> Any ideas???
>
>
>
>
>
>
>
> ---
>
> Stephen A. Mazzei
>
> Systems Administrator | AFDS, ASRC Federal Data Solutions - P&G HPC Account
> | 513-634-9965
>
>
>
>
> ________________________________
>
> The preceding message (including attachments) is covered by the Electronic
> Communication Privacy Act, 18 U.S.C. sections 2510-2512, is intended only
> for the person or entity to which it is addressed, and may contain
> information that is confidential, protected by attorney-client or other
> privilege, or otherwise protected from disclosure by law. If you are not the
> intended recipient, you are hereby notified that any retention,
> dissemination, distribution, or copying of this communication is strictly
> prohibited. Please reply to the sender that you have received the message in
> error and destroy the original message and all copies.
>
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>


More information about the Flask mailing list