82👍
✅
You’re missing comma (,
) inbetween:
>>> ((1,2) (2,3))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object is not callable
Put comma:
>>> ((1,2), (2,3))
((1, 2), (2, 3))
1👍
There is comma missing in your tuple.
insert the comma between the tuples
as shown:
pack_size = (('1', '1'),('3', '3'),(b, b),(h, h),(d, d), (e, e),(r, r))
Do the same for all
- [Django]-Django: show the count of related objects in admin list_display
- [Django]-Django multiple template inheritance – is this the right style?
- [Django]-Is "transaction.atomic" same as "transaction.commit_on_success"?
0👍
Tuple needs commas between values as shown below:
myTuple = (("a", "b"), (1, 2))
↑ ↑ ↑
# Commas are needed
In addition, this below is Tuple type:
myTuple = (("a", "b"))
And these below are also Tuple type:
myTuple = (("a",))
myTuple = (("a"),)
myTuple = (("a",),)
myTuple = ((),)
myTuple = (())
But, this below is not Tuple. This below is String type:
myTuple = (("a"))
And this below causes error:
myTuple = ((,))
- [Django]-Foreign Key Django Model
- [Django]-403 Forbidden error when making an ajax Post request in Django framework
- [Django]-Django ModelForm: What is save(commit=False) used for?
Source:stackexchange.com