Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Is there a a function to implement when dealing with django image or filefield? Please help me out [closed]
This is the error that I am getting Os error function not implemented -
Django AgoraRTC
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'play') at joinAndDisplayLocalStream DevTools failed to load source map: Could not load content for http://127.0.0.1:8000/static/assets/AgoraRTC_N-production.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE -
django TimeStampedModel not auto adding time stamps in drf APITestCase
I have a model which inherits TimeStampedModel to auto-add created and modified fields. I have an API that takes post data and creates objects. Everything is working fine when I am testing the API with the postman. But when I am testing the API with DRF test cases then I am getting the error django.db.utils.IntegrityError: null value in column "created" violates not-null constraint DETAIL: Failing row contains (101, null, null, 3600, 3, 6). I am getting this error only when I call the API from test cases. Otherwise, this is working fine in the postman and react frontend. This is the model. class Activity(TimeStampedModel): time_spent = models.IntegerField() # in seconds activity_type = models.ForeignKey( ActivityType, on_delete=models.CASCADE, related_name='activities') user = models.ForeignKey('user.User', on_delete=models.CASCADE) This is the API. @action(detail=True, methods=['post'], serializer_class=ActivitySerializer, url_name='add_activity') def add_activity(self, request, pk): # add activity for a activity type activity_type = self.get_object() serializer = self.serializer_class(data=request.data) if serializer.is_valid(): serializer.save(user=request.user, activity_type=activity_type) return Response(serializer.data, status=status.HTTP_201_CREATED) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) And this is the Test Case. def test_add_activity_succeed(self): self.client.credentials(HTTP_AUTHORIZATION=f'Token {self.token}') data = {"time_spent": 3600} activity_type = ActivityType.objects.create(name="test1", user=self.user) response = self.client.post(reverse('activity_types-add_activity', kwargs={'pk': activity_type.id}), data=data) self.assertEqual(response.status_code, status.HTTP_201_CREATED) I also have some other models which also inherit TimeStampedModel. And test cases are working fine while creating … -
How to investigate slow Heroku application
I deployed my first two applications on a free Heroku account, but the performance is terribly slow. Is it with my code? Do I need to upgrade my Heroku subscription? How do I investigate what's wrong? 1st App: Django Rest API for backend 2nd App: React for frontend -
Python set comprehension with multiple Django object fields
I have a queryset with many attributes and potentially 1000s of rows. I use set comprehension to identify unique attributes within the queryset in order to create dropdown filters that help users filter the objects in a table. Currently, I have created a set comprehension for each filtered attribute. Is there a more efficient way to obtain these unique attribute values? qs = Foo.objects.filter(criteria=unique_to_each_user) filter_name = sorted({q.name for q in qs if q.name}) filter_group = sorted({q.group for q in qs if q.group}) filter_origin = sorted({q.origin for q in qs if q.origin}) For a few attributes, I also create a tuple that contains total count along with each unique attribute: l_team = lambda x: x.team team_totals = {total: sum(1 for q in qs) for total, qs in groupby(sorted(qs, key=l_team), l_team)} filter_team = sorted({(q.team, team_totals.get(q.team)) for q in qs if q.team}) I use qs for other purposes, and was attempting to avoid several trips to the DB by performing the set comprehension actions on qs, as opposed to using a technique at the DB level, such as distinct - link. However, these set comprehensions are hurting performance. Perhaps I am misguided in minimizing DB queries above all else? Is there a better … -
Best way to generate a token with django
I have an app where the backend is in django rest framework. The frontend is in react. The app has two sets of apis. One set interacts with the react frontend (lets call them frontend apis). The other set are apis that the customer can directly use. (lets call them customer apis) The react frontend has a "Generate a new token". With this token, the user can begin using the customer apis. The token used with the customer apis will expire but the lifetime which can be set by the user in the frontend. How should I implement authentication for customer apis and frontend apis. -
Which is the best way to validate mutually exclusive fields in a Django Serializer?
I Have the following serializer: class MutuallyExclusiveSerializer(serializers.Serializer): field_a = serializers.Charfield() field_b = serializers.Charfield() field_c = serializers.Charfield() I want an scalable way to raise an error if the user send more than 1 of these fields that are mutually exclusive. I can make a custom validator but it is not easy to scale if more fields are added in the future. What is the recommended methodology in this case? Thanks in advance! -
Django webpack loader respecting STATICFILES_STORAGE setup
I have a Django project that uses webpack loader to work with vue with the following settings DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage' So, for example, if we hav <script src="{% static "js/main.js" %}"></script>, Django will convert it, into, say, https://my_service_url.com/static/js/main.js That's fine. But the trouble starts with bundles generated by webpack loader, for which I have the following settings WEBPACK_LOADER = { 'DEFAULT': { 'CACHE': False, 'BUNDLE_DIR_NAME': '/bundles/', # must end with slash 'STATS_FILE': os.path.join(FRONTEND_DIR, 'webpack-stats.json'), 'POLL_INTERVAL': 0.1, 'IGNORE': [r'.+\.hot-update.js', r'.+\.map'], } } And in my vue.config.js file const BundleTracker = require("webpack-bundle-tracker"); const pages = { ... } module.exports = { publicPath: '/static/', outputDir: './dist/', chainWebpack: config => { config.optimization .splitChunks(false) config .plugin('BundleTracker') .use(BundleTracker, [{filename: '../frontend/webpack-stats.json'}]) config.resolve.alias .set('__STATIC__', 'static') config.devServer .public('/static/') .host('0.0.0.0') .port(8080) .hotOnly(true) .watchOptions({poll: 1000}) .https(false) .headers({"Access-Control-Allow-Origin": ["\*"]}) }, pages: pages }; So, the issue is that under this setup, Django tries to look up the bundles using the address http://localhost:8006/static/js/my_bundle.js instead of https://my_service_url.com/static/js/my_bundle.js How do I make this work ? I guess I have to adjust the module.exports somehow... -
django: use model methods without create instance
I have a Model Product with business methods. I can for instance run Product.simulation(). My model contains relationship with other Models. Let's say my Product is serialized as / can be created from: { "name": "productA", "items": [2,3,13], "dealer": [1,2] } I would like to be able to compute Product.simulation with those values without creating it. I have multiple signals and batch operation on Product Model I dont want to run on the only for simulation objects. I could create a for_simulation attribute on Product and specify on my signals / batch operation to don't run on those instances but it seems do lead to duplicate code and be forgotten on some signals / batch. On the other hand, I could rewrite all my methods in Product, Item, Dealer to work with dict as input but there's a lot of them. Is there a better way to achieve my goal ? Ideally I would like to be able to do something like: p = Product({ "name": "productA", "items": [2,3,13], "dealer": [1,2] }) p.simulation() I cannot: my instances need to be saved to build relationships. -
Force a Django QuerySet to not hit the db?
I'm trying to improve query performance by use of prefetch_related and select_related. My goal is to only make one database query for a particular operation. Currently the way I'm determining whether I achieved my goal (only make one query) is to watch the database logs. I'd like to that to be easier, and ideally enforce that future changes don't undo my work. Is there a way I can tell a QuerySet to not hit ever the database (raise an exception if it can't fulfill a request from the cache)? -
More efficient and effective queryset?
I have this models in my project: ... class User(AbstractBaseUser): ... income = models.BigIntegerField() ... class Credit(models.Model): ... user = models.ForeignKey(User, on_delete=models.PROTECT) cycle = models.CharField(choices=CYCLE_CHOICES, max_length=2) amount = models.BigIntegerField() ... I want a queryset that queries the database for a user whose income is greater than $10,000, and who has at least two(2) credits whose cycle is cycle_credited and amount is $30,000. Currently, I have the following querysets: ... user = get_object_or_404(User, id=id) is_eligible = False num_of_ten_k_credits = Credit.objects.filter(user=user, user__income__gt=10000, cycle=constants.cycle_credited, amount=30000).count() if num_of_ten_k_credits >= 2: is_eligible = True Is there a more efficient and effective way to do this? Like a one-liner solution with fewer DB calls? -
why is my django site url the same as the directory path on the server?
I am deploying a django site for the first time to a cpanel server using phusion passenger on cloudlinux and it is finally working but i have discovered a weird phenomenon and I do not know if it is normal. when I go to base url of the site the homepage comes up as expected and when I click on any link the page loads fine but the url displays the full path from the /home directory. So, for example, rather than - https://website.net/django_app , I get - https://website.net/home/userdir/django_site/django_app I suspect that this can be corrected in .htaccess but I'd really like to know what's going on. Here is my passenger_wsgi.py file which I got from this site (https://www.a2hosting.co.uk/kb/developer-corner/python/installing-and-configuring-django-on-linux-shared-hosting) as the cpanel automatically generated passenger_wsgi did not work ; 1 import os 2 import sys 3 4 import django.core.handlers.wsgi 5 from django.core.wsgi import get_wsgi_application 6 7 # Set up paths and environment variables 8 sys.path.append(os.getcwd()) 9 os.environ['DJANGO_SETTINGS_MODULE'] = 'django_site.deployment_settings' 10 11 # Set script name for the PATH_INFO fix below 12 SCRIPT_NAME = os.getcwd() 13 14 class PassengerPathInfoFix(object): 15 """ 16 Sets PATH_INFO from REQUEST_URI because Passenger doesn't provide it. 17 """ 18 def __init__(self, app): 19 self.app = app … -
Django delete an object
Good day, I have a Model object, which contains the user who created it, as well as the one specified in a form. with localhost:800/delete/int:title_id/ the one object is deleted. Question: How can I make sure that user a user who also created the object can delete it. If userXY owns the object with ID 123 and he calls localhost:800/delete/123, the object will be deleted. But if OtherNutzerYX calls localhost:800/delete/123, the object will not be deleted because the object does not belong to him, but to UserXY. models.py class NewTitle(models.Model): user = models.ForeignKey( settings.AUTH_USER_MODEL, default=None, null=True, on_delete=models.CASCADE, ) title = models.CharField(max_length=200) creator_adress = models.GenericIPAddressField(null=True) id = models.BigAutoField(primary_key=True) def __str__(self): return str(self.title) urls.py path('delete/<int:title_id>/', views.title_delete), views.py def title_view(request): titles = NewTitle.objects.all() custom_title_id = random.randint(1111, 1111111111111) if request.method == 'POST': form = NewTitleForm(request.POST, instance=NewTitle(user=request.user)) if form.is_valid(): obj = form.save(commit=False) obj.creator_adress = get_client_ip(request) obj.id = custom_title_id while NewTitle.objects.filter(id=obj.id).exists(): obj.id = random.randint(111, 11111111111) obj.save() return redirect('/another') else: form = NewTitleForm() return render(request, 'test.html', {'form': form, 'titles': titles}) def title_delete(request, title_id): if #WHAT CODE HERE?: NewTitle.objects.filter(id=title_id).delete() else: return redirect('https://example.com') return HttpResponseRedirect('/another') The relevant code is the title_delete function. I don't know what to write in the if statement. It has something to be like: 'if … -
Faccing issue while exporting csv file in django
I am exporting a CSV file on the frontend as the user clicks on the download button, but sometimes I get an empty file and sometimes I get the exact file that I want. This is happening only on the deployment of the app. The function which is doing all this is : (the channel_list contains a list of dictionaries which has 'url' as key) def exportfile(request): response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachement; filename="channelUrls.csv"' writer = csv.writer(response) for list in channel_list: writer.writerow([list['url']]) channel_list.clear() return response The function which is inserting data to channel_list is : channel_list = [] def home(request): context = {'message' : ""} if request.method == 'POST': rows = [] video_id = [] file = request.FILES["file"].readlines() for f in file: rows.append((f.decode('utf-8'))) for row in rows[0:len(rows)-1]: video_id.append((row[-13:])) video_id.append((rows[len(rows)-1][-11:])) video_id = [x.replace("\r\n","") for x in video_id] search_url = 'https://www.googleapis.com/youtube/v3/videos' parameter = { 'key' : settings.YOUTUBE_DATA_API_KEY, 'part' : 'snippet', 'id' : ','.join(video_id) } data = requests.get(search_url,params=parameter) results = data.json()['items'] temp_list = [] for result in results: data = { 'name' : result['snippet']['channelTitle'], 'url' : f'https://www.youtube.com/channel/{ result["snippet"]["channelId"] }' } temp_list.append(data) [channel_list.append(x) for x in temp_list if x not in channel_list] context['message'] = "Click on Download File to download the file" return render(request,'index.html',context) … -
Trigger onchange via Selenium from Python
I have a Django webapp displaying a form. One of the fields is a FileField, defined via the Django model of the form: class Document(models.Model): ... description = models.CharField(max_length=100, default="") document = models.FileField(upload_to="documents/", max_length=500) The document filefield has an onchange ajax function attached. This is the code of the html page as displayed: <div class=""> <input type="file" name="document" onchange="checkFileFunction(this.value, &#x27;/ajax/check_file/&#x27;)" class="clearablefileinput form-control-file" required id="id_document"> </div> Now, I'm trying to test this with pytest via Selenium. I can send the file path to the field via send_keys(). However, the onchange event seems not to be triggered. (It does work fine when I select the file manually.) file_field = self.driver.find_element(By.NAME, "document") file_field.clear() file_field.send_keys(str(path/to/myfile)) This will register the file fine and it will be uploaded, but the onchange function never happens. I have searched and it seems others also have encountered the problem of send_keys not triggering the onchange event. But I have not been able to implement any of the suggested solutions in my Python code. (I'm not at all firm with JavaScript, yet.) The only solution I understood how to implement was sending a TAB or ENTER afterwards (file_field.send_keys(Keys.TAB)) to change the focus, but that triggers an selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: … -
Python file not getting the values from html file in django for login page
Hello I am new to django so pardon my mistakes. I have made a small login page but I am not able to get the user input values in the textbox to the python (i.e. views.py). Can anyone tell me why? This is my urls page from . import views from django.urls import path, include urlpatterns = [ path('', views.login), path('user_login/',views.studlogin,name='user_login/'), ] This is the views.py file studlogin function def studlogin(request): if request.method == 'POST': username = request.POST.get('Username') password = request.POST.get('Password') if username=="jake": return render(request, 'new.html') The html code for the login page that is index.html is {% load static %} <!DOCTYPE html> <html class=''> <head> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src='https://production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/aperyon/pen/oxzpaE?depth=everything&order=popularity&page=23&q=translate&show_forks=false" /> <style class="cp-pen-styles">html, body { border: 0; padding: 0; margin: 0; height: 100%; } body { background: tomato; display: flex; justify-content: center; align-items: center; font-size: 16px; } form { background: white; width: 40%; box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.7); font-family: lato; position: relative; color: #333; border-radius: 10px; } form header { background: #FF3838; padding: 30px 20px; color: white; font-size: 1.2em; font-weight: 600; border-radius: 10px 10px … -
Cache.get() not returning anything
My Cache settings, CACHES = { "default": { "BACKEND": "util.redis.ExtendedCache", "LOCATION": "redis://%s:%i/1" % (REDIS_HOST, REDIS_PORT), "TIMEOUT": 7 * 24 * 60 * 60, # One week in seconds "OPTIONS": { "SOCKET_TIMEOUT": 1, "CLIENT_CLASS": "util.redis.ExtendedClient", "CONNECTION_POOL_KWARGS": {"max_connections": 1}, "SERIALIZER": "util.redis.FailsafePickleSerializer", }, }, } When I'm doing the following in a view function, from django.core.cache import cache cache.set(key, value) Its not returning anything when I'm querying the same in shell, cache.get(key) # returns nothing! -
Django admin - autocomplete(_field) without foreignkey or manytomany relationship
I was wondering whether there is a function which lets me implement an autocomplete_field without having this variable be linked to another relation via a foreign key. I.e. I have the models Aaa, Bbb, & Ccc. Bbb & Ccc are related using a foreign key, while Aaa is related to the other two models through even other models. Now I want on the admin side a specific field Ccc, which consists of a field in Aaa, to be autocomplete with the values from Aaa (or at least a suggestion feature so that mistakes are minimized). However, Ccc and Aaa are not directly related; thus, I find it invalid to just assign this item a foreign key. Any suggestions on how to resolve this? As you can figure from my question, I am pretty new to django and would be very grateful for some help here. -
Test django pagination ordering on ListView with large page size
I have a view with a fixed pagination size of 100. I need to test that the ordering is correct, given the pagination. Looking at this example I can create 100 + 1 objects, then test that the expected objects are returned, but this takes a very long time (1 minute+). Is there a way to reduce the pagination size on a generic.ListView for tests? I essentially want to test that the get_queryset method is returning the correct results. Here is my slow running test so far: def test_custom_ordering(): """ test that page ordering is correct, and works with pagination standard page size is 100 NOTE populating 100 results takes a long time, thus we run all ordering tests in this method """ feedbacks = [] # create 101 feedbacks on consecutive days for i in range(0, 102): feedbacks.append( factory.create_feedback( date=datetime(2021, 1, 1) + timedelta(days=i), ) ) # no ordering specified => default: requested_at response = requests.get(f'{URL_NAME}?order_by=date') results = response.html.findChildren("table")[0].findChildren("tr") # expect feedback 0 (oldest) up to 101 (100 page size) # first of results is header, so ignore utils.check_same_results(feedbacks[:100], results[1:]) -
403 Forbidden error in django app hosting on apache with postgres db
I know with sqlite you run the commands: chmod 664 ~/myproject/db.sqlite3 sudo chown :www-data ~/myproject/db.sqlite3 sudo chown :www-data ~/myproject These will give apache access to the db, but how do would I go about doing this with postgres? Thanks -
502 Bad Gateway error with Nginx and Django channels
I'm trying to set up web sockets in my Django application. I'm using Nginx as a reverse proxy and I run the Django application with manage.py runserver without using gunicorn or daphne. When I run just the application locally, I can connect to the web sockets and they work, but when running it with Nginx I get 502 Bad Gateway. upstream web-dev { server web_dev:8080 fail_timeout=600; } server { listen 8050; location /api/ws/ { proxy_pass http://web-dev; proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 1d; } location / { proxy_pass http://web-dev; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; } } -
ModuleNotFoundError: No module named 'jiraglean.jiraglean'; 'jiraglean'
I am trying to run a tests file in a Django project, the app is called jira and project jiraglean , test file is tests.py I run the test with: jiraglean test jira.tests --settings=core.settings.test Which causes this error: File "/Users/pavel/.pyenv/versions/3.8.2/lib/python3.8/runpy.py", line 86, in _run_code File "/Users/pavel/.pyenv/versions/3.8.2/lib/python3.8/multiprocessing/context.py", line 57, in Manager exec(code, run_globals) File "/Users/pavel/Library/Caches/pypoetry/virtualenvs/jiraglean-VXquq6c2- py3.8/bin/jiraglean", line 2, in <module> from jiraglue.jiraglue import run ModuleNotFoundError: No module named 'jiraglean.jiraglean'; 'jiraglean' is not a package I am in a poetry virtual env when doing this. I don't understand why it is looking for the project in the bin folder of the cache, as it is obviously not there. Relevant files/folders. jiraglean ├─ core │ ├─ management │ ├─ permissions │ ├─ settings │ │ ├─ __init__.py │ │ ├─ base.py │ │ ├─ ci.py │ │ ├─ dev.py │ │ └─ test.py │ ├─ __init__.py │ ├─ api.py │ ├─ pagination.py │ ├─ serializers.py │ ├─ urls.py │ ├─ utils.py │ └─ wsgi.py ├─ jira │ ├─ __init__.py │ ├─ admin.py │ ├─ api.py │ ├─ apps.py │ ├─ models.py │ ├─ serializers.py │ ├─ tests.py │ └─ views.py -
Google CloudSQL warnings flooding logs
For the past few days I get the following two warning entries in my logs every half a second, to the point that the logs (without filtering) are useles. CloudSQL warning: your action is needed to update your application and avoid potential disruptions. Please see https://cloud.google.com/sql/docs/mysql/connect-overview for additional details: googleapi: Error 400: Invalid request: Invalid value for region: . Region name can't be empty., invalid and failed to refresh the ephemeral certificate for ###############: googleapi: Error 400: Invalid request: Invalid value for region: . Region name can't be empty., invalid The url they point you at is of no use, and there is not region name setting anywhere. Anyone faced a similar issue? This is an appengine standard environment django app and the cloudsql is msql if that helps -
How to create a custom student group and add students to that group?
I am creating a student project management system and each student will have a group with project. Only the admin will be able to add the students to the specific group using a drop down list menu. So far, I have create a student model and a group model such as these. class Student(models.Model): user = models.OneToOneField(User,null=True,on_delete=models.CASCADE) id = models.IntegerField(max_length=11,primary_key=True) course_taken = models.CharField(max_length=50,null=True) specialization = models.CharField(max_length=50,null=True) area_of_interest = models.CharField(max_length=50,null=True) group = models.ForeignKey(Group,null=True) def __str__(self): if self.user.first_name and self.user.last_name: full_name = self.user.first_name + " " + self.user.last_name return full_name class Group(models.Model): id = models.AutoField(primary_key=True) members = models.OneToManyField(User,through='Student') project_id = models.ForeignKey(Project,null=True) How to continue from this ? -
Fixture not found pytest
Hey I got a simple test where the fixure is not found. I am writting in vsc and using windows cmd to run pytest. def test_graph_add_node(test_graph): E fixture 'test_graph' not found > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. This is the error I get, here is the test code: import pytest import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'giddeon1.settings') import django django.setup() from graphs.models import Graph, Node, Tag @pytest.fixture def test_graph(): graph = Graph.objects.get(pk='74921f18-ed5f-4759-9f0c-699a51af4307') return graph def test_graph(): new_graph = Graph() assert new_graph def test_graph_add_node(test_graph): assert test_graph.name == 'Test1' im using python 3.9.2, pytest 6.2.5. I have see some similar questions but they all handle wider or bigger problems.