NEW THINGS ABOUT DJANGO
1. Without F() expressions this would be accomplished with either raw SQL or filtering in Python (which reduces the performance especially when there are lots of objects).
2. * unpacks a list or tuple into position arguments.
** unpacks a dictionary into keyword arguments.
>>> lis=[1, 2, 3, 4]
>>> dic={'a': 10, 'b':20}
>>> functionA(*lis, **dic) #it is similar to functionA(1, 2, 3, 4, a=10, b=20)
(1, 2, 3, 4)
{'a': 10, 'b': 20}
3.
Comments
Post a Comment