About Adding Non-numeric List Items Together
You can add non-numeric list items together with the reduce
function, e.g.:
from functools import reduce
import operator
from django.contrib.postgres.search import SearchVector
# dynamically set up list
vectors = [SearchVector(...), SearchVector(...), SearchVector(...)]
# add the vectors together
vector = reduce(operator.add, vectors)
Tips and Tricks Programming Django 5.x Django 4.2 Django 3.2 Python 3
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You