Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django relationship failing on IntegrityError even though the connected object was already created
So I'm running the following code: def decorate(func): method_inst = Method.objects.create(name=func.__qualname__, class_m_id=cls_id) @wraps(func) def wrapper(*args, **kwargs): for arg in args: arg_inst = Argument() arg_inst.method_id = method_inst.id arg_inst.save() return func(*args, **kwargs) return wrapper return decorate and I'm getting the following error: django.db.utils.IntegrityError: The row in table 'main_argument' with primary key '1' has an invalid foreign key: main_argument.method_id contains a value '11' that does not have a corresponding value in main_method.id. It seems like Django is not finding the Method instance that I have created before. Even though it is obviously created because the method_inst.id would not exist otherwise (it is generated automatically only after the object was created). Also, we know it is populated, because the error message is clearly saying main_argument.method_id contains a value '11'. Also, looking at the database I can see it was created. Any ideas why this is happening? -
Django - reverse_lazy & multiple parameters
I stuck in the redirect url after adding a new object. I have a simple class bassed create method and form. urls.py: path('', views.home, name='home'), path('<int:branch_id>/<int:doc_type_id>/', views.documents, name='documents'), path('<int:branch_id>/<int:doc_type_id>/add', testForm.as_view(), name='document_add'), path('<int:branch_id>/<int:doc_type_id>/<int:pk>', detailsView.as_view(), name='details_view'), form.py: class TestDocumentForm(ModelForm): class Meta: model = Document fields = '__all__' views.py: class testForm(FormView): template_name = "template/add.html" form_class = TestDocumentForm success_url = reverse_lazy('app:home') And this works perfectly. But I don,t know how to change a success_url based on reverse_lazy and arguments in the class-based function. I need this to redirect to the details page after clicking the save button. In the HTML code, I know how to do this. I tried using this solution (i.a. https://stackoverflow.com/a/41905219), so in the testForm function I commented the sussec_url field, I added something like this (): def get_success_url(self, **kwargs): reverse_lazy('archive:details_view') params = urlencode({'branch_id': self.object.branch.id, ...}) ... And I got the error: 'testForm' object has no attribute 'object'. I tried many solutions but I can't redirect the page with multiple. Thanks for any advice! -
How can I solve this error, since I want to migrate the models.py to be able to continue but that stuck there
(info) C:\Users\adruz\OneDrive\Escritorio\nuevo blog\proyecto\nuevo_blog>python manage.py makemigrations Traceback (most recent call last): File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django\apps\config.py", line 243, in create app_module = import_module(app_name) File "C:\Users\adruz\AppData\Local\Programs\Python\Python39\lib\importlib_init_.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'base' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\proyecto\nuevo_blog\manage.py", line 22, in main() File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\proyecto\nuevo_blog\manage.py", line 18, in enter code heremain execute_from_command_line(sys.argv) File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django\core\management_init_.py", line 425, in execute_from_command_line utility.execute() File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django\core\management_init_.py", line 401, in execute django.setup()enter code here File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django_init_.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Users\adruz\OneDrive\Escritorio\nuevo blog\entorno\info\lib\site-packages\django\apps\config.py", line 245, in create raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Cannot import 'base'. Check that 'aplicaciones.base.apps.BaseConfig.name' is correct. -
Django REST framework generic views vs custom function based views
I am wanting to refactor views.py in my Django project. Currently it is all function based views with different backend logic for each api endpoint. Most of the logic deals with taking in some input, running queries, and then manipulating the data before sending back to the front end. Wondering how to standardize this as I would like to have better structure. Also wondering how useful these views are? Can't see using it all that much and if I want a list I can just query the database accordingly and do whatever I want with it inside one of my function based views (e.g. merge with other data or filter). Also wondering how necessary serializers are? Before understanding what their full function was I found alternatives and have been able to send data back and forth to the front end just fine (mainly using things like values_list() or values() at the end of a query and creating dictionaries to send to the front end). Using React for the front end and connecting with Axios. -
What is the difference between django channels Asynchronous and Synchronous consumer
I was trying the django channels official tutorial. I completed upto Synchronous consumers and I found that its working fine. I have also tried in incognito. Here is a demo of the code: . In the documentation it's said: This is a synchronous WebSocket consumer that accepts all connections, receives messages ... For now it does not broadcast messages to other clients in the same room. But when I send message, it is shown in other windows . I have a few more questions : Why is it necessary to have async consumer / or what's the point? How it helps Does is decrease server performance When should I use it and when not Am I missing anything? Apologies for any mistake. Thanks for any kind of help. Merry Christmas :) -
TypeError: __init__() got an unexpected keyword argument 'providing_args'
I am creating a Django website. I was recently adding permissions/search functionality using the allauth package. When I attempt to run the website through docker I receive the error message: File "/usr/local/lib/python3.9/site-packages/allauth/account/signals.py", line 5, in user_logged_in = Signal(providing_args=["request", "user"]) TypeError: init() got an unexpected keyword argument 'providing_args' What is causing this error? I know usually a type error is caused by incorrect models.py files but I can't seem to access this file since it is a part of an external package. Urls.py urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path('accounts/', include('accounts.urls')), path('', include('climate.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: import debug_toolbar urlpatterns = [ path('__debug__/', include(debug_toolbar.urls)), ] + urlpatterns Models.py class Country(models.Model): id = models.UUIDField( primary_key= True, db_index = True, default=uuid.uuid4, editable= False ) name = models.CharField(max_length=50) population = models.IntegerField(default=1) emissions = models.FloatField(default=1) reason = models.CharField(default="", max_length=100) flags = models.ImageField(upload_to='images/', default="") page = models.URLField(max_length=300, default="") def save(self, *args, **kwargs): super(Country, self).save(*args, **kwargs) class Meta: verbose_name_plural = 'countries' indexes = [ models.Index(fields=['id'], name='id_index') ] permissions = { ("special_status", "Can read all countries") } def __str__(self): return self.name def flag(self): return u'<img src="%s" />' % (self.flags.url) def get_absolute_url(self): return reverse('country_detail', args =[str(self.id)]) flag.short_description = 'Flag' My settings.py that handles allauth. AUTH_USER_MODEL = … -
Django-Entangled multiple data in JsonField
Working with django JsonField. Using django-entangled in form. I need data format like below. Need suggestion to avail this. [ { "name": "Test 1", "roll": 1, "section": "A" }, { "name": "Test 2", "roll": 2, "section": "A" } ] -
How to loop trough objects in html
i wana loop trough my cateogrys in my html, im makeing a filter that will show all of the cateogys but i cant get my {% for %} to work i need some help heres my code. Ask if theres any more info that you need to solve this. HTML: <div class="filter-box"> <h1>Filter</h1><hr> {% for category in categorys%} <p class="checkbox-text">Hello</p> <h1>AAAAAAAAAAAAAAA</h1> {% endfor %} </div> Views: def category_all(request): categorys = Category.objects.all() return render(request, "product/dashboard_test.html", {"names": categorys}) Models: class Category(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=255, blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) -
How is it possible to clean the html code rendered with django-crispy form?
I have a django app and when i see the source html code on the browser it looks like this: it is ugly and not clean... and when using django-crispy forms, the generated form is worse.. I would like to show it like this: How is it possible to clean the html code rendered with django-crispy form? -
Altering the database with only one pytest-django session
I am using pytest-django 4.1 with Django 2.2 in my app. I have two databases for my tests: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'default_db', 'USER': '', 'PASSWORD': '' }, 'second': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'second_db', 'USER': '', 'PASSWORD': '' }, } During each test session these two databases are created: Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')... Creating test database for alias 'second' ('file:memorydb_default?mode=memory&cache=shared')... I don't want to use them all the time, only for a few tests. So I am looking for a way to enable creation of second database only for some sessions. Unfortunately I couldn't find a way to do this. Django documentation about tests recommends to use modify_settings or override_settings but it's not working for pytest-django. I tried to use django_db_setup fixture or pytest_sessionstart hook but I ended up with the situation where the db_router is correctly changed but the database is not, so the django configuration isn't really reset by editing settings.DATABASES after pytest is configured. I could make it work only for the whole configuration like: # project/conftest.py def pytest_configure(config): from django.conf import settings settings.DATABASE_ROUTERS = [] settings.DATABASES.pop('second', None) Is there a way to alter the django.conf.settings.DATABASES between the sessions in … -
Send post request using data from mapbox
How can I send data from marker on the map by POST request. I'm using Django and I want to get coordinates from marker which set by user. -
Is there a Ternary Operator in python
I'm trying to do a ternary like operator for python to check if my dictionary value exist then use it or else leave it blank, for example in the code below I want to get the value of creator and assignee, if the value doesn't exist I want it to be '' if theres a way to use ternary operator in python? Here's my code : in_progress_response = requests.request("GET", url, headers=headers, auth=auth).json() issue_list = [] for issue in in_progress_response['issues'] : # return HttpResponse( json.dumps( issue['fields']['creator']['displayName'] ) ) issue_list.append( { "id": issue['id'], "key": issue['key'], # DOESN'T WORK "creator": issue['fields']['creator']['displayName'] ? '', "is_creator_active": issue['fields']['creator']['active'] ? '', "assignee": issue['fields']['assignee']['displayName'] ? '', "is_assignee_active": issue['fields']['assignee']['active'] ? '', "updated": issue['fields']['updated'], } ) return issue_list -
django: Dynamically and securely change form value from template for loop for form saving to database
So I have a database of "stuff" that is essentially static and not editable by users, this is a repo of things that users are allowed to save. However, users can save copies of this stuff to a separate "user_stuff" database as the user unique stuff will have data that is unique to each user. class public_stuff(models.Model): name = models.CharField(max_length=100, unique=True) description = models.TextField(blank=True) def __str__(self): return self.name class user_stuff(models.Model): name = models.CharField(max_length=100) stuff = models.ForeignKey(public_stuff, on_delete=models.DO_NOTHING) user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) description = models.TextField() def __str__(self): return self.name On my actual page I am rendering a list of all public stuff (for now, I only have two things in public_stuff at the moment for test purposes), as well as a list of all of a users stuff. For each public stuff entry, I would ideally like to have a button that the user can click to "save" a copy of that entry to their stuff, but the problem is I am not sure how to do this securely. The main roadblack is that I would ideally like to display each entry via a foor loop, as the list will be dynamic in both size and composition. As a result, I … -
format count integar into percentage inside annotate in Djnago rest
I have to send the percentage of counts in the api call in DRF. I have calculated the counts and attach to the queryset using annotate. But actaully I need the percentage rather than the count. TYPES = ((1,'cold'), (2,'humid'), (3,'hot')) from django.db.models import Q,Count class Destinations(models.Model): continent = models.CharField() /............/ class Packages(models.Model): location = models.Foreignkey(Destination,on_delete=models.CASCADE,related_name='packages') place_type = models.CharField( max_length=1, choices=TYPES, default="" My view: I have use list function inside modelviewset, something like this: Destiantion = Destination.objects.all().annotate(total_packages=Count('packages'), cold_count=Count('packages',filter=Q(packages__place_type=1)), humid_count=Count('packages',filter=Q(packages__place_type=2)), hot_count =Count('packages',filter=Q(packages__place_type=3))) Here I get the response as counts of package types in the attributes, but I want is the percentage of package type like 25% by doing cold_count*100/total_packages but cant use this inside annotate. There is a count() method which might be useful but if I used that I have to make 4 separate queries and might be writing another api just for that. So I have to use annotate. But how?? -
Django Admin Sortable 2 - Inline Tabular - not save order and display hidden field
I was using Python 3.9, Django 3.2.8, and Django-admin-sortable2 1.0.3. I was facing issue that my custom order field (I named it "sort_order") was visible in inline tabular forms but it should have been hidden as per Django-admin-sortable2 implementation. And although I was able to drag-and-drop items, but upon saving the parent object, the sort order wasn't getting saved. What worked for me? -
Why does Django's union mess up the column order?
If I have 2 models: class Hero(models.Model): hero_name = models.CharField(max_length=50) hero_age = models.PositiveSmallIntegerField() hero_identity = models.TextField(max_length=50) def __str__(self): return self.hero_name class Villain(models.Model): villain_name = models.CharField(max_length=50) villain_age = models.PositiveSmallIntegerField() villain_identity = models.TextField(max_length=50) def __str__(self): return self.villain_name and I create some test instances: Hero(hero_name="Superman", hero_age=30, hero_identity="Clark Kent").save() Hero(hero_name="Iron Man", hero_age=35, hero_identity="Tony Stark").save() Hero(hero_name="Spider-Man", hero_age=18, hero_identity="Peter Parker").save() Villain(villain_name="Green Goblin", villain_age=45, villain_identity="Norman Osborn").save() Villain(villain_name="Red Skull", villain_age=38, villain_identity="Johann Schmidt").save() Villain(villain_name="Vulture", villain_age=47, villain_identity="Adrian Toomes").save() Listing them individually works fine, but listing them using a union breaks the order somehow: >>> from django.db.models import F >>> from myapp.models import Hero, Villain >>> for hero in Hero.objects.all().annotate(name=F("hero_name"), age=F("hero_age"), identity=F("hero_identity")).values("name", "age", "identity"): ... print(hero) {'name': 'Superman', 'age': 30, 'identity': 'Clark Kent'} {'name': 'Iron Man', 'age': 35, 'identity': 'Tony Stark'} {'name': 'Spider-Man', 'age': 18, 'identity': 'Peter Parker'} >>> for villain in Villain.objects.all().annotate(name=F("villain_name"), age=F("villain_age"), identity=F("villain_identity")).values("name", "age", "identity"): ... print(villain) {'name': 'Green Goblin', 'age': 45, 'identity': 'Norman Osborn'} {'name': 'Red Skull', 'age': 38, 'identity': 'Johann Schmidt'} {'name': 'Vulture', 'age': 47, 'identity': 'Adrian Toomes'} >>> all = Hero.objects.all().annotate(name=F("hero_name"), age=F("hero_age"), identity=F("hero_identity")).union(Villain.objects.all().annotate(name=F("villain_name"), age=F("villain_age"), identity=F("villain_identity"))) >>> for person in all.values("name", "age", "identity"): ... print(person) {'name': 1, 'age': 'Green Goblin', 'identity': 45} {'name': 1, 'age': 'Superman', 'identity': 30} {'name': 2, 'age': 'Iron Man', 'identity': 35} {'name': 2, … -
How do I match a title of post and text of post in django
I started learning django a few weeks ago and I have run in to a problem that I can't figure out. Here is the exercise:enter image description here Models.pyenter image description here Views.pyenter image description here Blogs.htmlenter image description here Blog.html enter image description here urls.pyenter image description here Thanks in advance! -
Django: render a word document that is saved in a query object
I have an app where in my models.py I included a welcome text: welcome_text = models.FilePathField(path="/text") The file is located at app/static/text/welcome_text.docx I thought I could use {{app.welcome_text}} in my html-template, but it doesn't give anything back. Which pre-and suffix can be used to define a word document? Is it possible to render the word document that is correctly saved in the database ? -
unable to pass data from views to js file having chart js codes, shows unexpected syntax error
I am trying to make analytics for my webapp, where it whould show data from db graphically. I am using chart js for this. I am learning how to do it from youtube. Strangely they are not getting any error where as I am getting this Uncaught SyntaxError: Unexpected token '{' these are the codes that I have written views.py monthly_visitor = VisitorCount.objects.all().values( 'date_of_record__month' ).annotate( total_in_month=Count('ip') # take visitor_id or whatever you want to count ).order_by() yearly_visitor = VisitorCount.objects.all().values('date_of_record__year').annotate( total_in_year= Count('ip') ).order_by() print("\nthe values of monthly visitors are", monthly_visitor, "\n") visitorMonthNumber = [] visitorNumberMonthly = [] for i in range(len(monthly_visitor)): visitorMonthNumber.append(monthly_visitor[i]['date_of_record__month']) visitorNumberMonthly.append(monthly_visitor[i]['total_in_month']) print("\nthis is the list of month number =", visitorMonthNumber, "\n", "\nthis is the number of visitors", visitorNumberMonthly, "\n") context = { 'visitorMonthNumber': visitorMonthNumber, 'visitorNumberMonthly': visitorNumberMonthly } return render(request, "chart.html", context) In the above code I am querying a model named visitor count to get the number of visitors on every month. js file var visitorMonthNumber = {{visitorMonthNumber}}; var visitorNumberMonthly = {{visitorNumberMonthly}}; const visitorM = document.getElementById('visitorMonthly').getContext('2d'); const visitorMonthly = new Chart(visitorM, { type: 'bar', data: { labels: visitorMonthNumber, datasets: [{ label: 'Monthly Visitors', data: visitorNumberMonthly, backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', … -
Need a Solution for my scenario with Python and Django
I have a Django web app, we have a code that pulls the sales data from API with to and from date and also we want to store it in data base(MYSQL) or data warehouse. I need some help how to design the below part of avoiding duplication and optimized code? Lets say the database or data-warehouse already contains data in it. How can we avoid writing duplicate data to DB or DW if the API pulls the existing data? Even if we compare with the existing records, it usually takes so much of time what is the best optimized way? Thank you -
Django website unabale to register new users
I am following Antoinio Mele's -Django by example to build a Social Website but everythime I try to register a new user through the register.html template all I get is a blank form ,neither does the webiste create a new user. I've followed everything that's said in the tutorial. My views.py from django.shortcuts import render from django.http import HttpResponse from django.shortcuts import render from django.contrib.auth import authenticate, login #from .forms import LoginForm,UserRegistrationForm from .forms import LoginForm,UserRegistrationForm from django.contrib.auth.decorators import login_required def user_login(request): if request.method == 'POST': form = LoginForm(request.POST) if form.is_valid(): cd = form.cleaned_data user = authenticate(request,username=cd['username'], password=cd['password']) if user is not None: if user.is_active: login(request,user) return HttpResponse('Authenticated successfully') else: return HttpResponse('Disabled account') else: return HttpResponse('Invalid login') else: form = LoginForm() return render(request,'account/login.html',{'form':form}) @login_required def dashboard(request): return render(request, 'account/dashboard.html', {'section':'dashboard'}) def register(request): if request.method == 'POST': user_form = UserRegistrationForm(request.POST) if user_form.is_valid(): # Create a new user object but avoid saving it yet #new_user = user_form.save(commit=False) new_user = user_form.save() # Set the chosen password new_user.set_password( user_form.cleaned_data['password']) # Save the User object new_user.save() # Create the user profile # Profile.objects.create(user=new_user) return render(request, 'account/register_done.html', {'new_user': new_user}) else: user_form = UserRegistrationForm() return render(request, 'account/register.html', {'user_form': user_form}) My urls.py from django.urls import path from django.contrib.auth … -
How i can to pass instance to docxtpl in django framework?
I have a models with relationship such as ForeignKey, ManyToManyField and model method for calculate something. When i query a data from database i got a instance. i want to pass instance to docxtpl because it fast in develop. example code in models.py class Customer(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=50,,null=True,blank=True) birthdate = models.DateField(max_length=100,null=True,blank=True) status = models.ForeignKey('status ',on_delete=models.CASCADE) something = models.ManyToManyField('Something',blank=True) def get_age(self): diff = relativedelta(datetime.date.today(),self.birthdate ) return diff example code in generate_docx.py. I know doc.render() require a dictionary but i want to pass instace because it easy to use in template.docx from docxtpl import DocxTemplate def generate_document(instance): doc = DocxTemplate("template.docx") doc.render(instance) doc.save("generated_doc.docx") # example generate docx customer = Customer.objects.get(uuid="UUID_CUSTOMER") generate_document(customer) example template.docx Lorem Ipsum is simply dummy text of the printing and typesetting industry. {{customer.name}} age {{customer.geta_age}} {% for c in customer.somthing.all %} {{c}} {% endfor %} I want to know how to pass instance to docxtpl or convert instance that have relationship and model method to dict use for docxtpl in compatible. thank for expert -
How to get all the messages (or the data) from a group in django channels?
I am a bit new to Django and have been trying to work on a chat application utilizing Django Channels. Recently, I got stumbled upon an issue where there is a need to get all the data (if any) associated with a group. I have searched in the docs and other places for a workaround but was unable to find anything useful. Is it possible to interact with the Redis databases associated with the channel layers being used via something like Redis client for Python and get data in that way? Or should I try to store any newly generated messages separately for each group in the cache? (I think the latter technique will create unnecessary overhead since an extra copy of all the messages associated with a group will be there) Can someone help me with this problem? Thanks for reading! -
How to solve this loop to print all the values?
It should print 5,3.33 but it is only printing 3 ?How to print both values bucket_data22={1: {'key': 'Security Awareness Overview', 'value': 20, 'start_date': '13/07/2021', 'end_date': '12/08/2021', 'id': 155}, 2: {'key': 'Security Awareness Overview', 'value': 0, 'start_date': '13/07/2021', 'end_date': '12/08/2021', 'id': 159}, 3: {'key': 'Security Awareness Overview', 'value': 30, 'start_date': '24/09/2021', 'end_date': '27/09/2021', 'id': 174}} completed_data={155: 1, 174: 1} for z in completed_data: print(z) for i in bucket_data22: if (bucket_data22[i]['id']==z): print((completed_data[z]/bucket_data22[i]['value'])*100) -
manage.py error after Wagtail 2.15 upgrade
After upgrading to Wagtail 2.15 (or 2.15.1) from 2.14.2 my production website with postgres and database search breaks and commands run with manage.py give an error despite me adding the required WAGTAILSEARCH_BACKENDS to settings. I have to web apps with separate settings running from the same Wagtail version. One of the apps (putkeep) has a search bar and the other (secretgifter) does not. After upgrading Wagtail from 2.14.2 to 2.15 putkeep gives a 404 error but secretgifter does not. If I use pip to switch back to 2.14.2 the 404 error goes away and the site loads (although results from a search give a 500 error). If I run makemigrations (or any other command that uses manage.py for secretgifter it works fine. For putkeep (with the search) it gives the following error: File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute django.setup() File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate app_config.ready() File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/apps.py", line 21, in ready set_weights() File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 44, in set_weights BOOSTS_WEIGHTS.extend(determine_boosts_weights()) File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 32, in determine_boosts_weights boosts = get_boosts() File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 26, in get_boosts boosts.add(boost) TypeError: unhashable type: …