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.2 Django 4.2 Django 3.2 Python 3
Also by me
Django Messaging 🎅🏼
For Django-based social platforms.
Django Paddle Subscriptions 🎅🏼
For Django-based SaaS projects.
Django GDPR Cookie Consent 🎅🏼
For Django websites that use cookies.