Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to avoid hard-coding URLS in the static files on Django?
Is there any techniques to avoid hard coding URLs, especially the URLS for ajax calls in an external static resource file like JavaScript files in Django. -
Sort DRF serializer output of DictField by key
I have a Django Rest Framework serializer that uses a DictField: class FlatArticleSerializer(Serializer): attributes = DictField(child=FlatArticleAttributeSerializer()) The output is all the time different, since the attributes are a dictionary, which is by definition not sorted. Is there a way to sort these in the output nevertheless, alphabetically on string for instance? -
Make a comparison between two querysets
I have performed two queries: remote_table_values = self.remote_table.data.model_class().objects.values(self.selected_column.field.name) local_table_values = self.local_table.data.model_class().objects.values() Giving the results: <QuerySet [{'3': 1.0}, {'3': 2.0}]> <QuerySet [{'id': 3, '28': 1.0, '29': 'Ben'}, {'id': 4, '28': 2.0, '29': 'Adam'}, {'id': 5, '28': 3.0, '29': 'Dan'}]> where the keys are columns (the id key represents the id of a row) and the values are the cell values. I am trying to perform a comparison between the values with the key '3' from the first queryset and the values with the key '28' in the second queryset. My problem is that when I actually perform the comparison I don't know what the key of the second queryset is. So, I have been trying something like this: selected_column = self.to_column.field.name st = 'in' filter = selected_column + '__' + st local_table_fails = self.local_table.data.model_class().objects.exclude(**{ filter: remote_table_values }) This obviously fails at the moment because filter evaluates to '3' which isn't present in the other queryset. How can I write the comparison so that I can compare the values (I basically need to make sure that every value in the local table is present in the remote table)? Any help would be much appreciated! Thanks for your time. -
POST Form action not working properly [Django]
I'm new to Django and I'm trying to fill the contentString of a Google Maps Marker with the following content: for (i=0; i< Object.keys(j).length; i++){ venue_name = j[i]['name'] contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<h1 id="firstHeading" class="firstHeading">'+j[i]['name']+'</h1>'+ '<div id="bodyContent">'+ '<p><b>'+j[i]['name']+'</b></p>'+ '<p>Attribution: '+j[i]['name']+', <a href="https://www.google.es/#q='+j[i]['name']+" "+city+'">'+ 'Más información</a> '+ '</p>'+ '<button onclick="calculateAndDisplayRoute('+ j[i]['lat'] +','+ j[i]['long'] +')">Ir!</button>'+ '<li><a href = "{% url 'detail' 'venue_name' %}">Ver comentarios</a>'+ '</div>'+ '</div>'; The main idea is that the href link will send the venue_name variable to the detail view so it can retrieve the requested information from de data base. The problem is, venue_name is interpreted as a string, but if I remove the quotes then I get this error: Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['venuesApp/(?P\w+)/$'] It should be the correct sintax if I'm not mistaken, so I'm assuming it has something to do with the fact that the whole HTML code is inside a JS string. I have another POST form outside the JS script code and it works just fine. urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^(?P<venue_name>\w+)/$', views.detail, name='detail'), Thanks in advance -
Should I use session for saving user data? Django
I'm new to django and I think sessions would be the best thing for my use case, but I'm not sure, maybe there are better possibilities? This is my application simplified: Users should be able to select any number of train connections out of a database, and my application returns the best average mobile phone operator for their connections. My models would be the following: User, in which all the connections are saved Connection, in which the quality of the mobile net for different operators is saved And to save the users (and thus their choosen connections) I would have used sessions, which save the user_id. Is this possible and recommended? Thanks in advance DarkShark -
Host a "non-django app" (a folder with index.html, some .js and .css) in a django website
Short brief: I have some “non-django html apps” (a folder with a index.html, some .js files and a .css file) and I want to execute them in a django website without touching their code. How can I do it? How can I make work inside django a non-django app (a folder with an index.html, some .js and .css) withou touching the code of the app? Details: I'm building a website with Django where i want to host some Construct3 games (it allows you to create HTML5 through a GUI). When you export a Construct3 game to HTML it creates the following structure: C3App |_ appmanifest.json |_ c2runtime.js |_ data.js |_ index.html |_ offline.js |_ offlineClient.js |_ register-sw.js |_ start.js |_ style.css |_ sw.js |_ icons | |_ icon1.png |_ images |_ image1.png That is what I have tried: 1.- In my Django website I dropped the C3App in my template folder and created a view and called index.html. As a result i got a blank page with not found errors (404) for: appmanifest.json, icon1.png, style.css, c2runtime.js, start.js and register-sw.js. That is the external files called in index.html. 2.- As that dindn't work, I moved C3App to my static folder and … -
how to fix this error in Django UnboundLocalError?
UnboundLocalError: local variable 'watched_serial' referenced before assignment in thisline exactly in defaults but every Variables is exists. even if you print it, they show up!!!!!!!!!!!! mark_it_watched, created = watched_series.objects.get_or_create(user=request.user, watched_serial__slug=serial_slug, watched_serie__slug=series_slug, defaults={"user":user, "watched_serial":watched_serial, "watched_serie":watched_serie, "minutes_of_series":minutes_of_series}) this is my views def mark_and_unmark_this_episode(request, serial_slug=None, season_slug=None, series_slug=None): return_dict = {} data = request.POST is_delete = data.get('is_delete') if is_delete == 'true': mark_it = watched_series.objects.get(user=request.user, watched_serial__slug=serial_slug, watched_serie__slug=series_slug, minutes_of_series__slug=series_slug) #m = watched_series.objects.get(user=user, watched_serial=instance.watched_serial) mark_it.delete() update_profile, created = UserProfile.objects.filter(user=request.user) if not created: update_profile.series_watched_nmb -= 1 update_profile.save(force_update=True) if is_delete == 'false': seriess = Series.objects.filter(serial_of_this_series__slug=serial_slug, season_of_this_series__slug=season_slug, slug=series_slug) for i in seriess: watched_serial = i.serial_of_this_series watched_serie = i minutes_of_series = i user = request.user mark_it_watched, created = watched_series.objects.get_or_create(user=request.user, watched_serial__slug=serial_slug, watched_serie__slug=series_slug, defaults={"user":user, "watched_serial":watched_serial, "watched_serie":watched_serie, "minutes_of_series":minutes_of_series}) if not created: mark_it_watched.user = user mark_it_watched.watched_serial = watched_serial mark_it_watched.watched_serie = watched_serie mark_it_watched.minutes_of_series = minutes_of_series mark_it_watched.save(force_update=True) return_dict["watched_info"] = list() product_dict = {} product_dict["user"] = request.user product_dict["watched_serial"] = seriess.serial_of_this_series product_dict["watched_serie"] = seriess product_dict["minutes_of_series"] = seriess return_dict["watched_info"].append(product_dict) print(return_dict) return JsonResponse(return_dict) -
Serializer doesn't have fields inside __init__ function
There is a Serializer FooSerialyzer with the field bar: class FooSerialyzer(serializers.HyperlinkedModelSerializer): bar = serialyzer.CharField() def __init__(self, **kwargs): # some custom fields logic Problem: Now there are some unittests in the project. The problem is that there is one test that fails - only if ran after other tests. The tests are to complex, so there is really no point to post them. I have put a debugger inside the __init__ and here is what I get. When test ran alone: (Pdb) self FooSerialyzer(): bar = serialyzer.CharField() When test ran after other tests: (Pdb) self FooSerialyzer(): Question: what could cause the Serialyzer to not have fields when ran after other tests? The tests are located in separate files, and use separate setup - can't even imagine how they could influence one another. -
How to update plotly chart using django
I'm trying to create a personal website to display a real-time Coffe quotes graph using django as the website's framework and plotly to plot the graph. I need my template to keep the old graph values and just update it with the new ones in a timely manner. Example: Every 10 seconds a function is called and my graph is rebuilt adding a new value-pair to its previous values. I'll put the code I've written so far so that it becomes a bit more clearer: class CafeView(TemplateView): def get_context_data(self, **kwargs): price = float(soup.find("td", {"class": "pid-8832-last"}).get_text()) # This is the actual Coffe price which is scraped from a website, I suppressed unnecessary info to clean the code up a little bit. context = super(CafeView, self).get_context_data(**kwargs) context['preco'] = price try: list_prices # Checks if list already exists except NameError: list_prices = [] # Creates it if it doesnt list_prices.append(price) # Appends scraped price else: list_prices.append(price) # appends price to existing list try: list_hours # Checks if variable exists except NameError: list_hours = [] # Creates it if it does not actual_time = str(datetime.datetime.now()) hora, ponto, ms = actual_time.split()[1].partition('.') list_hours.append(hora) # Appends hour to list else: actual_time = str(datetime.datetime.now()) hora, ponto, ms = … -
Gzipping within nginx rather than Django?
What's the best practice and why? For instance: I currently gzip http responses with Django Gzip middleware. Can I gain on the user experience side by any mean? -
'reversing' access to Django admin, using perms
I'm looking for a way to grant access to users in a group (which has a custom permission added) to a custom-written admin view, and only that view. Since the group doesn't have permission to access to any model-related views, such as add/change/delete, Django throws a 403 by default when trying to do so. I'd like to extend this behavior to all views in all apps in a given project, except when the opposite is explicitly stated. Guess i'm looking for a kind of baseview or -method to be implicitly inherited. But pretty much got stuck at trying overloading the init of admin.ModelAdmin, since it's pre-loaded. My last resort would be a middleware, but i rather not go there.. -
Get filter choise in template
Google suggests to use different titles and different meta tags on each site page. In my Django project I use - https://github.com/carltongibson/django-filter And now I have for example - ordering desc and ordering asc google recognise as different pages. As we should set title and meta tag description different on each page which google crawl recognises, how could I get info about ordering and other filter settings from django-filter in html template? Thanks! -
How to limit # queries made when Django model property is based on ManyToManyField
I'm building a read API for an existing (legacy) SQL database using Django Rest Framework. The problem is that way too many queries are made. I want to select a Widget and its (about 40) related widgets, including the widget_technology for each of the related widgets. The technology of a widget depends on the presence or absence of a certain tag (I realize it's suboptimal database design but it's legacy...). The problem is that this results in 40+ queries (one per related widget). Is there any way to fix it? I've been looking at prefetch_related('widget_tags') in the DRF part of the code, but that doesn't seem to help. Here is the main table: class Widgets(models.Model): widget_id = models.AutoField(primary_key=True) widget_name = models.CharField(max_length=70) widget_tags = models.ManyToManyField('Tags', through='IsTag') related_widgets = models.ManyToManyField('Widgets', through='Similar', related_name='similar') @property def widget_technology(self): if self.widget_tags.filter(tag_slug='tech_1').exists(): return 'TECH_1' elif self.widget_tags.filter(tag_slug='tech_2').exists(): return 'TECH_2' class Meta: managed = False db_table = 'widgets' For completeness, here are the other tables: class Similar(models.Model): first_widget = models.ForeignKey( Widgets, models.DO_NOTHING, primary_key=True, related_name='similar_first_widget' ) second_widget = models.ForeignKey( Widgets, models.DO_NOTHING, related_name='similar_second_widget' ) score = models.IntegerField() class Meta: managed = False db_table = 'similar' unique_together = (('first_widget', 'second_widget'),) class IsTag(models.Model): is_tag_widget = models.ForeignKey(Widgets, models.DO_NOTHING, primary_key=True) is_tag_tag = models.ForeignKey('Tags', models.DO_NOTHING) class … -
How to render a variable in a django template?
My goal is to write dynamically some urls of images in the HTML page. Urls are stored in a database. To do so, first I am trying to render a simple varable in a template. Reading the docs and other sources, it should be done in 3 steps: For the configuration: in settings.py TEMPLATES = [ { 'OPTIONS': { 'debug': DEBUG, 'context_processors': [ … 'django.template.context_processors.request', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages', ], }, }, ] The variable name in the template: In MyHTMLFile.html is foo … <td>MyLabel</td><td><p>{{ foo }}</p></td><td>-----------</td> … in the view.py, one of the lines myvar1 ="BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" context = {foo: myvar1,} return render_to_response("MyHTMLFile.html", context, context_instance = RequestContext(request) ) return render(request, 'MyHTMLFile.html', {foo: myvar1}) return render_to_response("MyHTMLFile.html", context , context_instance=RequestContext(request) ) return render(request, 'MyHTMLFile.html', context) The html page is well rendered, but no data in the html table. Do you have an idea ? I am curious to know what i misunderstand. Regarding the versio, i am using: python: Python 2.7.13 django: 1.10.5 Thank you -
django-radius Settings and Connectivity issues
I'm fairly new to Django and am trying to develop a simple login page for users that authenticates what was originally to an LDAP server, but will now be a RADIUS server. After giving up on django_auth_ldap for Python3, I've instead decided to switch my backend authentication to RADIUS. I recently installed the django-radius package and would first like simply to test that the RADIUS-Django tandem is functioning as it should be, before developing more advanced features. The problem I'm encountering is on several levels, but first some insight into my scripts (based on the information given in the Example Project section): settings.py AUTHENTICATION_BACKENDS = ( 'users.backends.MyRADIUSBackend', 'django.contrib.auth.backends.ModelBackend', ) RADIUS_SERVER = 'localhost' RADIUS_PORT = 1812 RADIUS_SECRET = 'S3kr3T' backends.py from radiusauth.backends import RADIUSRealmBackend RADIUS_SERVERS = { 'client1.myproject.com': ('10.21.0.52', 1812, 'random1'), 'client2.myproject.com': ('10.21.0.53', 1812, 'random2'), } class MyRADIUSBackend(RADIUSRealmBackend): def get_server(self, realm): if realm in RADIUS_SERVERS: return RADIUS_SERVERS[realm] return None The backends.py file resides in a users directory, along with forms.py and urls.py. The form to login into, resides in an app in my project called user_auth. When I login into the page after python manage.py runserver I receive the following error message: SyntaxError at /login/ invalid syntax (radius.py, line 131) which … -
Using Filtering with django-filter or ElasticSearch
I need to filter results using whether Django-filter or Elastic-search. I've got both installed in my app. I've used tutorials from different websites but the results is not as expected. My Model.py: class Wine(models.Model): name = models.CharField(max_length=200) release_date = models.DateTimeField(default=datetime.datetime.now) My filter.py: from django import forms from .models import Manufacturer, Wine import django_filters class WineFilter(django_filters.FilterSet): release_date = django_filters.NumberFilter(name='release_date', lookup_expr='year') name = django_filters.CharFilter(lookup_expr='icontains')' class Meta: model = Wine fields = ['name', 'release_date'] My view.py: def search(request): wine_list = Wine.objects.all() wine_filter = WineFilter(request.GET, queryset=wine_list) return render(request, 'reviews/wine_list.html', {'filter': wine_filter}) In case of using Elastic Search: My search_filters.py class WineIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) name = indexes.CharField(model_attr='name') release_date = indexes.CharField(model_attr='release_date') def get_model(self): return Wine def index_queryset(self, using=None): return self.get_model().objects.all() My form.py: from django.forms import ModelForm, Textarea from haystack.forms import SearchForm class WineSearchForm(SearchForm): def no_query_found(self): return self.searchqueryset.all() Usually, to display the list of wine, I put this in my HTML: `{% for wine in wine_list %} {{ wine.name }} - {{ wine.release-date }} {% endfor %} But, I want to filter result with a side panel on the left of my actual wine_list.html. Most of the selection, will be done via select box: <!-- third Panel start Here --> <div class="panel panel-default"> <h4 … -
Django Admin Not Showing Correct Timezone Value Returned by Custom Method
I have a table field in my models that is a storing tz aware datetime's as UTC, along with a method to present the datetime in another tz, like so -- from django.db import models import datetime import pytz class Game(models.Model): start_time = models.DateTimeField(default=datetime.datetime.utcnow, blank=True,null=True) def start_time_as_et(self): '''returns start_time as ET, not as UTC''' eastern = pytz.timezone('US/Eastern') return self.start_time.astimezone(eastern) My admin.py has -- from django.contrib import admin from g.models import Game class GameAdmin(admin.ModelAdmin): list_display = ('start_time_as_et',) I thought that should display the ET version of the datetime in the admin interface, but I'm still getting the UTC showing in the admin interface. I tried removing the default from the start_time value but that didn't change anything. I'm not sure if I'm missing something about how this works or if this only works for True/False values (as in the Django tutorial). And yes, the TZ setting is set in the settings.py, so that's not a problem. I did some Googling but couldn't find out if anyone's had a problem like this before or how I can fix it. I'm using Django 1.11.x, Python 3.5.2, on Ubuntu 16.04. -
Django: How to get all users with profiles as JSON (extended User model)
I have extended the default User model in Django. Now my models look like following: class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) birth_date = models.DateField(auto_now=False, auto_now_add=False, default=datetime.now) phone_number = models.CharField(max_length=13, blank=True, default="") address = models.CharField(max_length=100, blank=True, default="") organization = models.ForeignKey(Organization, blank=True, null=True) Everything works fine, I am able to add new users through admin panel and so on. However, I have got a problem. I need to return a customize JSON response to certain request in form of [ {"firs_name": first_name, "phone_number": phone_number, ...}, {"firs_name": first_name, "phone_number": phone_number, ...}, ... ] As you can see, the phone_number attribute belongs to the Profile model, and I cannot get ALL users with their Profiles included (I am able to get only id of user). Here is the response I get for now: [{"username": "user", "profile": 2, "first_name": "User", "last_name": "User"}, {"username": "user1", "profile": 3, "first_name": "User1", "last_name": "User1"}, {"username": "user2", "profile": 4, "first_name": "User2", "last_name": "User2"}] Question: Is there any way to get all user objects with profile information included in it through User.Objects.all()? Thanks! P.S.: This is how I make custom JSON response: def get_users_as_json(request): all_users = User.objects.all().values("username", "first_name", "last_name", 'profile') user_list = list(all_users) return JsonResponse(user_list, safe=False) -
Catch an uploaded csv file using Django (No models, No forms)
I am failing to catch this uploaded csv file. I just want to upload a file, and store into a variable so I can use it later. template.html {% block content %} <h1>File content</h1> <form action="{% url 'plot:printInfo' %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <input id="uploadbutton" type="file" value="Browse" name="file" accept="text/csv" /><br> <input type="submit" value="Upload" /> </form> {% endblock %} views.py def printInfo(request): #PATH = '/Users/xxxxx_000/Desktop/Django/mysqlApp/plot/data/' #data = pd.read_csv(PATH + 'SalesJan2009.csv') csvfile = request.FILES['file'] data = pd.read_csv(csvfile) html = data.to_html() #method implemented below, It allows to add Id field to an HTML table finalString = addIdToHtml(html) context = { 'TableOfData': finalString, } #x and y are lists return render(request, 'filter.html', context) when I use data = pd.read_csv(PATH + 'SalesJan2009.csv') , it works pretty fine, Now All I want to do is to replace 'SalesJan2009.csv' by an uploaded file. Help PLEASE !! -
Relation does not exist when execute makemigrations
I'm using Postgres and Django. I changed my server on localhost to Amazon EC2. However, when I went to do 'python manage.py makemigrations' or 'python manage.py makemigrations myapp' appeared to me the following error: Relation [table_name] does not exist. Relationships / tables are not created in the Database. Can you help me? -
Using Django with Angular tutorial recommendations
We have a a Django 1.10 web application that we're thinking of updating to use AngularJS (probably v4). Can anyone recommend a good tutorial or approach that would help this effort? I have found a couple of tutorials on the web but haven't had much luck with them. Thanks -
Operational error in django admin, says no such table
I am a newbie in django. I run command manage.py makemigrations manage.py migrate manage.py sqlmigrate api 0001 Where api is the name of my app. It seems like migrations is successfull beacause I didn't get any error but when I routed to admin panel (default). Now when I select any model name it produces the error as below. Below is the errors shown: OperationalError at /admin/api/donation/ no such table: api_donation Request Method: GET Request URL: http://127.0.0.1:8000/admin/api/donation/ Django Version: 1.11.1 Exception Type: OperationalError Exception Value: no such table: api_donation Exception Location: /usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py in execute, line 328 Python Executable: /usr/bin/python3 Python Version: 3.5.2 Python Path: ['/home/kdpisda/Projects/creekside', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages'] Server time: Wed, 7 Jun 2017 12:21:51 +0000 Traceback: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/api/donation/ Django Version: 1.11.1 Python Version: 3.5.2 Installed Applications: ['dashboard', 'login', 'api', 'aboutus', 'contactus', 'ourprogram', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "/usr/local/lib/python3.5/dist-packages/django/db/backends/utils.py" in execute 65. return self.cursor.execute(sql, params) File "/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py" in execute 328. return Database.Cursor.execute(self, query, params) The above exception (no such table: api_donation) was the direct cause of the following exception: File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py" in _get_response … -
Is Django a good framework to start learning web programming? [on hold]
I want to learn some web framework and I'm in doubt witch one to choose: Angular 4 or Django. I know a little bit of Python, so Django was my first choice. But I don't know if it's worth it. -
Django: pass parameters to success_url when using Upadateview
The app name is notes. After I finish updating notes under /notes/note_id/modify_notes, I want to be redirected to /notes/note_id. Therefore I need to have parameter note_id(pk). I am new to Django. I went through the post success_url in UpdateView, based on passed value, but I didn't understand it. Thanks in advance! Code below: In views.py, class modify_notes(UpdateView): model = Notes fields = ['info_title', 'info_text', 'pic_file','comment'] template_name_suffix = '_update_form' In urls.py # /notes/note_id url(r'^(?P<notes_id>[0-9]+)/$', views.DetailView, name = "detail") # /notes/note_id/modify_notes url(r'^(?P<pk>[0-9]+)/modify_notes/$', views.modify_notes.as_view(), name='notes-modify'), -
Nested subqueries in Django
Getting into deep water with Subquery. I have a set of Carparks. Carparks have multiple Bookings. Bookings have many BarrierActivity records, which are the various coming and going events at the barriers. These are all simple FKs up the stack. It is possible for a booking to arrive and the barrier cameras not recognise it. A member of staff will buzz them in but that means the system has failed for some reason. And that's what I'm trying to do here. Work out what percentage of my bookings got in via automated means. I know there are a number of other ways of doing this, but I'd like to do this with a single subquery-based queryset. My aim reasonably simple. Annotate 0 or 1 to show whether or not an "entry" BarrierActivity exists for each Booking. Annotate an average of those values, per Carpark. The first part is fine. I can do a simple Exists() between BarrierActivity and Booking and then each booking has the 0 or 1: successful_bas = BarrierActivity.objects.order_by().filter( booking=OuterRef('pk'), activity_type=BarrierActivity.TYPE_ANPR_BOOKING, direction='entry' ).values('booking') Booking.objects.order_by().annotate( entry_success=Exists(successful_bas) ) And again, that works fine. But as soon as I try to scale that up another layer (so looking at Carpark instead …