Nope, can't get this to work either. This way, nothing works. Nothing will
display on the page this way, not the products nor the form.
I see now what you were trying to do in the 1st example, however as you
said, django templates won't allow that.
I was able to do the form in the template manuall
It's now a dict, so you have to index into it. The for loop won't magically
know which element of add_product_forms you want. You'd want
add_product_forms[item.pk].
But ugg... apparently Django templates won't (out of the box) let you index
a dict using another variable. Thanks for reminding me wh
Yeah, I'm obviously doing something wrong in the template, Stephen. I'm not
quite sure what I'm supposed to do (in the template). You kinda lost me on
the last sentence, "Then adjust your template to index into
add_product_forms based on item.pk."
Could you give me a hint, please? And thank you so
Thank for the answer, Stephen. However, I'm still a little confused, and it
apparently doesn't' work unless I'm doing something wrong in the template.
In the template, I'm supposed to change the "add_product_form" to
"add_product_forms" in the template?
In other words, "add_product_forms.quantity"
You assign to context every loop iteration. So at the end, only the last
add_product_form constructed is ever used. Try this:
def show_cart(request):
cart_id = _cart_id(request)
cart_items = CartItem.objects.filter(cart_id=cart_id)
add_product_forms = {}
for item in cart_items:
I am trying to display a modelformset_factory in a view, but am running
into this error and unable to figure out why.
builtins.AttributeError
AttributeError: 'IPAddressForm' object has no attribute 'instance'
This seems to happen when I include this in my view: {{
ipaddressformset.as_table }}
T
I'm working on an online shop, and I'm having a problem in the cart,
here's a screen shot (http://pasteboard.co/Vwnv2T0.png).
I'd like the form for each item (product) to show it's current quantity
(that's already been added to the cart)
as an initial value as most ecommerce sites do.
I've t
On May 14, 2016 1:19 PM, "Shu Latif" wrote:
>
> It's this line in names(ftes)
>
> results = conn.search_s("o=domain.com", ldap.SCOPE_SUBTREE, "uid=" +
ftes, attrlist=['gecos'])
>
getFTE() can return with a string or with a list. You are using that value
for ftes when calling names(ftes).
The
It's this line in names(ftes)
results = conn.search_s("o=domain.com", ldap.SCOPE_SUBTREE, "uid=" + ftes,
attrlist=['gecos'])
On Saturday, May 14, 2016 at 1:00:22 AM UTC-7, James Schneider wrote:
>
>
> On May 13, 2016 6:34 PM, > wrote:
> >
> > I'm basically trying to get employees of a man
So the following section from the docs has me a little confused:
=
Another side effect of using commit=False is seen when your model has a
many-to-many relation with another model. If your model has a many-to-many
relation and you specify commit=False when you save a form, Djan
I've done the official tutorial and the Django Girls tutorial (I like the
latter better ^.^) but now want to learn to build something nontrivial. I
saw a thread on Reddit that talked about frustrations arising from minor
inconsistencies between libraries and non-LTS releases. What would be your
Thank you, Florian! :-)
Indeed, stability and job market are what's on my mind. It's comforting to
know what I can stick to LTS versions and be assured of (almost 100%)
stability. Just another minor concern: What if, say, the other minor
upgrade rolls out a really cool feature that takes out a
On May 13, 2016 6:34 PM, wrote:
>
> I'm basically trying to get employees of a manger using ldap. The error I
get is TypeError at /aboutus-test/ cannot concatenate 'str' and 'list'
objects. I think the issue is it's taking the list of employees and trying
to put them all into a function rather tha
13 matches
Mail list logo