id
stringlengths
32
49
content
stringlengths
777
333k
swe-bench_data_django__django-12049
Applied migration detection may fail when using a case-insensitive collation Description (last modified by Tim Graham) Hello, I'm using this guide ​https://datascience.blog.wzb.eu/2017/03/21/using-django-with-an-existinglegacy-database for my studies with camelCasing together with Django (yes, I'm still trying...
swe-bench_data_django__django-12050
Query.resolve_lookup_value coerces value of type list to tuple Description Changes introduced in #30687 cause an input value list to be coerced to tuple breaking exact value queries. This affects ORM field types that are dependent on matching input types such as PickledField. The expected iterable return type should ...
swe-bench_data_django__django-12062
Allow disabling of all migrations during tests Description As an extension to #24919 a setting DATABASE['TEST']['MIGRATE'] = False should disable all migrations on that particular database. This can be done by hooking into django.db.migrations.loader.MigrationLoader.migrations_module() and returning None. diff --gi...
swe-bench_data_django__django-12073
Deprecate the barely documented InvalidQuery exception. Description The django.db.models.query.InvalidQuery exception is ​only mentioned once by name in the documentation without reference to its defining module. It's used for the documented QuerySet.raw usage and ​abused for ​field deferring select related misuse. I...
swe-bench_data_django__django-12091
Deprecate HttpRequest.is_ajax. Description (last modified by Mariusz Felisiak) As discussed on ​this django-developers thread this should be deprecated. It inspects the non-standard header X-Requested-Wiith that is set by jQuery and maybe other frameworks. However jQuery's popularity, especially for making requ...
swe-bench_data_django__django-12113
admin_views.test_multidb fails with persistent test SQLite database. Description (last modified by Mariusz Felisiak) I've tried using persistent SQLite databases for the tests (to make use of --keepdb), but at least some test fails with: sqlite3.OperationalError: database is locked This is not an issue when onl...
swe-bench_data_django__django-12121
Feature/docs: how should url converters decline to match for a named route? Description It is sometimes convenient to have multiple instances of a named route, where the correct one is chosen based on whether the URL converters to_url call succeeds. For example, the attached file has routes like this: path('export/f...
swe-bench_data_django__django-12122
template filter |date:"r" not valid RFC 2822 formatted when LANGUAGE_CODE different than english Description Documentation says template filter date with argument 'r' returns a valid RFC 2822 formatted date. But setting a LANGUAGE_CODE different than english makes the date returned not valid because the day abbreviat...
swe-bench_data_django__django-12125
makemigrations produces incorrect path for inner classes Description When you define a subclass from django.db.models.Field as an inner class of some other class, and use this field inside a django.db.models.Model class, then when you run manage.py makemigrations, a migrations file is created which refers to the inne...
swe-bench_data_django__django-12132
Add subdomains of localhost to ALLOWED_HOSTS in DEBUG mode Description (last modified by thenewguy) It would minimize configuration for new projects if ALLOWED_HOSTS += .localhost? when DEBUG=True Chrome resolves *.localhost to localhost without modifying any host files or DNS Referencing the project this way m...
swe-bench_data_django__django-12143
Possible data loss in admin changeform view when using regex special characters in formset prefix Description (last modified by Baptiste Mispelon) While browsing the code in admin/options.py [1] (working on an unrelated ticket), I came across that line: pk_pattern = re.compile(r'{}-\d+-{}$'.format(prefix, self....
swe-bench_data_django__django-12148
reverse() and get_absolute_url() may return different values for same FlatPage Description (last modified by Tim Graham) The FlatPage model implements get_absolute_url() without using reverse(). The comment suggests, that this handles SCRIPT_NAME issues, but the link in the admin interface does not work, if you...
swe-bench_data_django__django-12153
0011_update_proxy_permissions crashes in multi database environment. Description (last modified by haudoing) The tutorial said that we can omit to set the default database if default doesn't makes sense ​https://docs.djangoproject.com/en/2.2/topics/db/multi-db/#defining-your-databases But the following migratio...
swe-bench_data_django__django-12155
docutils reports an error rendering view docstring when the first line is not empty Description Currently admindoc works correctly only with docstrings where the first line is empty, and all Django docstrings are formatted in this way. However usually the docstring text starts at the first line, e.g.: def test(): ""...
swe-bench_data_django__django-12161
Support callable values in through_defaults. Description Ticket #9475 gave us through_defaults but unlike the defaults argument of get_or_create [1] or the default argument of any model field, it doesn't allow callable values. Callable values are passed through without being evaluated so the exact behavior depends on...
swe-bench_data_django__django-12172
Add ability to override "async unsafe" checks. Description It's been reported that Jupyter, at least, executes apparently-synchronous code in an async environment (​https://forum.djangoproject.com/t/is-there-a-way-to-disable-the-synchronousonlyoperation-check-when-using-the-orm-in-a-jupyter-notebook/548/3) and we're ...
swe-bench_data_django__django-12184
Optional URL params crash some view functions. Description My use case, running fine with Django until 2.2: URLConf: urlpatterns += [ ... re_path(r'^module/(?P<format>(html|json|xml))?/?$', views.modules, name='modules'), ] View: def modules(request, format='html'): ... return render(...) With Django 3.0, this is...
swe-bench_data_django__django-12185
Window expression are not allowed in conditional statements used only in the SELECT clause. Description Django raises NotSupportedError when using window expressions in conditional statements used only in the SELECT clause, e.g. Employee.objects.annotate( lag=Window( expression=Lag(expression='salary', offset=1), ...
swe-bench_data_django__django-12187
Allow configuration of where to save staticfiles manifest. Description A standard Django deploy has all staticfiles accessible to all users. This is understandable, if undesirable. By itself this is not a huge problem since those on the public Internet don't know the filenames of all of the files a deployment has, an...
swe-bench_data_django__django-12193
SplitArrayField with BooleanField always has widgets checked after the first True value. Description (last modified by Peter Andersen) When providing a SplitArrayField BooleanField with preexisting data, the final_attrs dict is updated to include 'checked': True after the for loop has reached the first True val...
swe-bench_data_django__django-12196
Add a safeguard to debug decorators (sensitive_variables/sensitive_post_parameters) to prevent incorrect usage. Description While trying to reproduce ticket:26480#comment:5, I noticed that Django happily lets you write this kind of code: @sensitive_variables # incorrect usage, should be @sensitive_variables() def is_...
swe-bench_data_django__django-12198
Allow sensitive_variables() to preserve the signature of its decorated function Description When the method authenticate of a custom AuthenticationBackend is decorated with sensitive_variables, inspect.getcallargs will always match. Calling the authenticate function will attempt to call this backend with any set of c...
swe-bench_data_django__django-12209
Change in behaviour when saving a model instance with an explcit pk value if the pk field has a default Description (last modified by Reupen Shah) Consider the following model: from uuid import uuid4 from django.db import models class Sample(models.Model): id = models.UUIDField(primary_key=True, default=uuid4)...
swe-bench_data_django__django-12212
DeserializationError local variable 'pk' referenced before assignment (which hides real error) Description The first error is this: Environment: Request Method: GET Request URL: http://localhost:8000/admin/artcollection/artobject/2298/history/734/ Django Version: 1.9.6 Python Version: 2.7.10 Installed Applications: [...
swe-bench_data_django__django-12225
Improve error message for admin.E202. Description If an inline has mutliple foreign keys to the same parent model, you get an error message like so: (admin.E202) 'account.PaymentApplication' has more than one ForeignKey to 'account.Invoice'. This error message should recommend specifying fk_name. diff --git a/djang...
swe-bench_data_django__django-12231
Related Manager set() should prepare values before checking for missing elements. Description To update a complete list of foreignkeys, we use set() method of relatedmanager to get a performance gain and avoid remove and add keys not touched by user. But today i noticed our database removes all foreignkeys and adds t...
swe-bench_data_django__django-12237
slugify() doesn't return a valid slug for "İ". Description While working on an international project, we discovered that the turkish/azerbaijani letter İ can not be properly processed when SlugField and slugify are run with allow_unicode=True. The project itself runs with Django 2.2.6 and Wagtail 2.6.2. I first talke...
swe-bench_data_django__django-12262
Custom template tags raise TemplateSyntaxError when keyword-only arguments with defaults are provided. Description (last modified by P-Seebauer) When creating simple tags without variable keyword args, but an keyword argument with a default value. It's not possible to supply any other variable. @register.simple...
swe-bench_data_django__django-12273
Resetting primary key for a child model doesn't work. Description In the attached example code setting the primary key to None does not work (so that the existing object is overwritten on save()). The most important code fragments of the bug example: from django.db import models class Item(models.Model): # uid = mod...
swe-bench_data_django__django-12276
FileInput shouldn't display required attribute when initial data exists. Description (last modified by thenewguy) I think that ClearableFileInput.use_required_attribute() (​https://github.com/django/django/blob/e703b93a656b78b9b444bb3a9980e305ed002a70/django/forms/widgets.py#L454) should be moved to FileInput.u...
swe-bench_data_django__django-12281
admin.E130 (duplicate __name__ attributes of actions) should specify which were duplicated. Description The fact that the __name__ is used is somewhat an implementation detail, and there's no guarantee the user has enough of an understanding of python to know what that attribute is, let alone how to fix it. This just...
swe-bench_data_django__django-12284
Model.get_FOO_display() does not work correctly with inherited choices. Description (last modified by Mariusz Felisiak) Given a base model with choices A containing 3 tuples Child Model inherits the base model overrides the choices A and adds 2 more tuples get_foo_display does not work correctly for the new tup...
swe-bench_data_django__django-12286
translation.E004 shouldn't be raised on sublanguages when a base language is available. Description According to Django documentation: If a base language is available but the sublanguage specified is not, Django uses the base language. For example, if a user specifies de-at (Austrian German) but Django only has de av...
swe-bench_data_django__django-12299
Raise a descriptive error on update()/delete() operations following QuerySet.union(), intersection(), and difference(). Description (last modified by Joon Hwan 김준환) b_filter() seems to merge but does not apply to the actual update q = M.objects.none() q = q.union(M.objects.a_filter()) print(q) q = q.union(M.obj...
swe-bench_data_django__django-12304
Enumeration Types are not usable in templates. Description (last modified by Mariusz Felisiak) The new ​enumeration types are great but can't be used in Django templates due to their being callable. For example this doesn't work: {% if student.year_in_school == YearInSchool.FRESHMAN %} This is because YearInSch...
swe-bench_data_django__django-12306
Named groups in choices are not properly validated in case of non str typed values. Description In case of using typed choices and string value to store it (in my case it is multiple values stored in char field as JSON) it is possible to catch error while run makemigrations (_check_choices error): main.MultiValueFiel...
swe-bench_data_django__django-12308
JSONField are not properly displayed in admin when they are readonly. Description JSONField values are displayed as dict when readonly in the admin. For example, {"foo": "bar"} would be displayed as {'foo': 'bar'}, which is not valid JSON. I believe the fix would be to add a special case in django.contrib.admin.utils...
swe-bench_data_django__django-12313
makemigrations does not detect/like model name case changes Description Starting with class Evidence(models.Model): rubrictype = models.ForeignKey('Rubrictype') class Rubrictype(models.Model): type_code = models.CharField(max_length=1) Make the initial migration: $ ./manage.py makemigrations Migrations for 'as_mig...
swe-bench_data_django__django-12325
pk setup for MTI to parent get confused by multiple OneToOne references. Description class Document(models.Model): pass class Picking(Document): document_ptr = models.OneToOneField(Document, on_delete=models.CASCADE, parent_link=True, related_name='+') origin = models.OneToOneField(Document, related_name='picking'...
swe-bench_data_django__django-12343
Admin: Render foreign key models as links for readonly users Description In the admin UI, when viewing a model for which you have view only permission, foreign key / m2m fields are rendered as plaintext representation of the target object. It would be nicer to render those as links instead so that a readonly user can...
swe-bench_data_django__django-12360
Add system check for the length of auth permissions codenames. Description I stumbled across this while performing some migrations on models with rather... descriptive names (my original model was dynamically created). Anyway, it looks like in cases where a model name is just under the 100 character limit, and contri...
swe-bench_data_django__django-12364
Detection of existing total ordering in admin changelist should take into account UniqueConstraints without conditions. Description I've been fiddling with db indexes lately to improve the performance of an admin view. Eventually I found this PR ​https://github.com/django/django/pull/10692 which ensures the records d...
swe-bench_data_django__django-12394
Raising error about protected related objects can crash. Description (last modified by Matthias Kestenholz) ====================================================================== ERROR: test_protect_via (delete.tests.OnDeleteTests) ---------------------------------------------------------------------- Traceback...
swe-bench_data_django__django-12396
Omits test_ prefix from database name when running subset of tests Description (last modified by Matthijs Kooijman) While debugging some test framework issues wrt mysql, I noticed a problem where the test runner would try to access the test database without prefixing test_, leading to an access denied error (be...
swe-bench_data_django__django-12406
ModelForm RadioSelect widget for foreign keys should not present a blank option if blank=False on the model Description Unlike the select widget, where a blank option is idiomatic even for required fields, radioselect has an inherent unfilled state that makes the "-------" option look suspiciously like a valid choice...
swe-bench_data_django__django-12407
{% include %} uses get_template where it could select_template Description It'd be nice if the Include template tag was sensible enough to allow fallbacks by selecting the most appropriate template, as things like render/render_to_response/render_to_string do. It's tripped me up on more than one occasion, and it seem...
swe-bench_data_django__django-12419
Add secure default SECURE_REFERRER_POLICY / Referrer-policy header Description #29406 added the ability for the SECURE_REFERRER_POLICY setting to set Referrer-Policy, released in Django 3.0. I propose we change the default for this to "same-origin" to make Django applications leak less information to third party site...
swe-bench_data_django__django-12430
Possible data loss when using caching from async code. Description CacheHandler use threading.local instead of asgiref.local.Local, hence it's a chance of data corruption if someone tries to use caching from async code. There is a potential race condition if two coroutines touch the same cache object at exactly the s...
swe-bench_data_django__django-12431
FileResponse with temporary file closing connection. Description (last modified by Oskar Persson) I think I might've found a regression in #30565. When I run the following tests (in their defined order) against Postgres I get the error below. import tempfile from django.contrib.auth import get_user_model from d...
swe-bench_data_django__django-12441
Calling a form method _html_output modifies the self._errors dict for NON_FIELD_ERRORS if there are hidden field with errors Description Each time the _html_output method of a form is called, it appends the errors of the hidden field errors to the NON_FIELD_ERRORS (all) entry. This happen for example when the form me...
swe-bench_data_django__django-12453
`TransactionTestCase.serialized_rollback` fails to restore objects due to ordering constraints Description I hit this problem in a fairly complex projet and haven't had the time to write a minimal reproduction case. I think it can be understood just by inspecting the code so I'm going to describe it while I have it i...
swe-bench_data_django__django-12458
Serialization dependency sorting disallows circular references unneccesarily. Description The core.serialization.sort_dependencies() function takes a list of apps and/or models, and resolves this into a sorted flat list of models, ready to be serialized in that order. This function is intended to make natural foreign...
swe-bench_data_django__django-12464
DISTINCT with GROUP_CONCAT() and multiple expressions raises NotSupportedError on SQLite. Description Contrary to what is suggested in ​lines 60-64 of django.db.backends.sqlite3.operations.py, SQLite does support DISTINCT on aggregate functions. One such example is GROUP_CONCAT, which is quite similar to PostgreSQL's...
swe-bench_data_django__django-12469
Admin date_hierarchy filter by month displays an extra day at timezone boundary. Description (last modified by Lavrenov Ivan) When I authorized by user with not-UTC timezone, like America/Los_Angeles , and open filter by date in month, I see one extra day, that follows to the first day of the previous month d...
swe-bench_data_django__django-12470
Inherited model doesn't correctly order by "-pk" when specified on Parent.Meta.ordering Description Given the following model definition: from django.db import models class Parent(models.Model): class Meta: ordering = ["-pk"] class Child(Parent): pass Querying the Child class results in the following: >>> print(C...
swe-bench_data_django__django-12477
fields.E310-E311 should take into account UniqueConstraints without conditions. Description Hello, I'm trying to create migration with this kind of model. class AppUsers(models.Model): name = models.CharField(...) uid = models.CharField(...) source = models.ForeignKey(...) class Meta: constraints = [models.Uni...
swe-bench_data_django__django-12484
system checks: admin.E002 could provide a hint but doesn't Description Currently the output is: myapp.MyCustomUserModel: (auth.E002) The field named as the 'USERNAME_FIELD' for a custom user model must not be included in 'REQUIRED_FIELDS'. because I accidentally had: USERNAME_FIELD = "email" EMAIL_FIELD = "email" REQ...
swe-bench_data_django__django-12485
MultiPartParser support double quotes Description Although the rfc2231 document does not indicate that values can be wrapped in double quotes. However, some third-party tools wrap the value in double quotation marks when wrapping HTTP requests (such as the filename of the file uploaded by PostmanCanary). This results...
swe-bench_data_django__django-12486
numberformat.format() incorrectly formats large/tiny floats in scientific notation Description (last modified by Tim Graham) For floats with values larger than 1e16 or smaller than 1e-5, their string representation uses scientific notation in Python, which causes numberformat.format to return an erroneous outpu...
swe-bench_data_django__django-12496
Child model updates parent model with empty fields making an extra query in multi-inheritance when parent model has custom PK Description While creating a new model object (using multi-inheritance model => Child(Parent)), Django does an extra update query setting parent model fields to empty values. This situation oc...
swe-bench_data_django__django-12497
Wrong hint about recursive relationship. Description (last modified by Matheus Cunha Motta) When there's more than 2 ForeignKeys in an intermediary model of a m2m field and no through_fields have been set, Django will show an error with the following hint: hint=( 'If you want to create a recursive relationship...
swe-bench_data_django__django-12503
makemessages doesn't provide feedback when no locale is specified Description (last modified by Cristóbal Mackenzie) makemessages requires that one of three flags be passed to specify locales for message building: --locale to explicitly specify locales, --exclude to specify locales to exclude, or --all to build...
swe-bench_data_django__django-12504
Logout link should be protected Description There is a logout link in admin app. It is link, not a form. Therefore it is not CSRF-protected. Probably it is not so important to protect logout from CSRF attack, because this fact cannot be used to do anything harmful. So this is just a request for purity. Another reason...
swe-bench_data_django__django-12508
Add support for ./manage.py dbshell -c SQL Description At the moment you cannot run specific SQL directly with dbshell: ./manage.py dbshell -c "select * from auth_group" You have to use pipes, that are not always convenient: echo "select * from auth_group" | ./manage.py dbshell If we add -c argument, it would be in s...
swe-bench_data_django__django-12513
Deprecate providing_args argument from Signal Description The argument is and always has been purely documentational. It provides no functionality or checking. Therefore, these values are stored in memory for no real use. Documentation can be handled just as easily by a code comment or real documentation articles. On...
swe-bench_data_django__django-12517
Inconsistent datetime logging from runserver. Description In Django 1.11 and higher, the runserver logging can sometimes be inconsistent. [16/Apr/2018 13:32:35] "GET /some/local/url HTTP/1.1" 200 7927 [2018-04-16 13:32:35,745] - Broken pipe from ('127.0.0.1', 57570) This is because logging from WSGIRequestHandler use...
swe-bench_data_django__django-12518
sqlmigrate doesn't allow inspecting migrations that have been squashed Description This project for another ticket can be used to reproduce: ​https://github.com/adamchainz/django-unique-together-bug When running sqlmigrate to pick up migration 0001 in this project, it complains that two migrations have that prefix: $...
swe-bench_data_django__django-12519
Subquery annotations are omitted in group by query section if multiple annotation are declared Description (last modified by Johannes Maron) Sadly there is more regression in Django 3.0.2 even after #31094. Background: It's the same query as #31094. I tried upgrading to Django 3.0.2 and now I get duplicate resu...
swe-bench_data_django__django-12532
forms.ModelMultipleChoiceField should use "invalid_list" as error message key Description The MultipleChoiceField uses "invalid_list", but ModelMultipleChoiceField uses "list" as the key for the similar error message. diff --git a/django/forms/models.py b/django/forms/models.py --- a/django/forms/models.py +++ b/dj...
swe-bench_data_django__django-12553
Increase default password salt size in BasePasswordHasher. Description (last modified by Jon Moroney) I've made a patch for this here ​https://github.com/django/django/pull/12553 Which changes the default salt size from ~71 bits to ~131 bits The rational is that modern guidance suggests a 128 bit minimum on sal...
swe-bench_data_django__django-12556
Deprecate using get_random_string without an explicit length Description django.utils.crypto.get_random_string currently has a default length value (12). I think we should force callers to specify the length value and not count on a default. diff --git a/django/contrib/auth/hashers.py b/django/contrib/auth/hashers....
swe-bench_data_django__django-12568
Django humanize's intword filter does not accept negative numbers. Description Django's humanize intword filter does not work with negative numbers. I have created a solution using absolute value. Here is my pull request: ​https://github.com/django/django/pull/12568 diff --git a/django/contrib/humanize/templatetag...
swe-bench_data_django__django-12588
Add option to remove_stale_contenttypes to remove entries for nonexistent apps. Description (last modified by Javier Buzzi) Add an option (disabled by default) to remove_stale_contenttypes command to remove entries also for nonexistent apps. Based on ​discussion. ​PR diff --git a/django/contrib/contenttypes/m...
swe-bench_data_django__django-12589
Django 3.0: "GROUP BY" clauses error with tricky field annotation Description Let's pretend that we have next model structure with next model's relations: class A(models.Model): bs = models.ManyToManyField('B', related_name="a", through="AB") class B(models.Model): pass class AB(models.Model): a = ...
swe-bench_data_django__django-12591
Can't replace global admin actions with specialized ones per-admin Description f9ff1df1daac8ae1fc22b27f48735148cb5488dd landed in 2.2 (discussion in #29917), which makes it impossible to replace a generic site-wide action (such as the built-in delete_selected) with a new one. It fails with the admin.E130 system check...
swe-bench_data_django__django-12613
XML serializer doesn't handle JSONFields. Description I have code: data = serializers.serialize("xml", queryset, fields=fields) if I choose specific fields, which are not JSONField, it is ok. But if I choose field, which is JSONField, I receive error File "/Users/ustnv/PycharmProjects/fpg_nko/venv/lib/python3.6/site...
swe-bench_data_django__django-12627
make_password shouldn't accept values other than bytes or string as an argument Description (last modified by iamdavidcz) Currently make_password function accepts almost every Python object as an argument. This is a strange behaviour and it results directly from force_bytes casting objects to str. We should thr...
swe-bench_data_django__django-12630
Add --check flag to migrate. Description (last modified by thenewguy) It would be helpful if there was a flag for migrate that acted similar to makemigrations --check that could be used to stop CI from deploying an application automatically when unapplied migrations exist. This is different from makemigrations ...
swe-bench_data_django__django-12663
Using SimpleLazyObject with a nested subquery annotation fails. Description (last modified by Jordan Ephron) Prior to 35431298226165986ad07e91f9d3aca721ff38ec it was possible to use a SimpleLazyObject in a queryset as demonstrated below. This new behavior appears to be a regression. Models from django.contrib.a...
swe-bench_data_django__django-12669
Add proper field validation to QuerySet.order_by. Description When you annotate a QuerySet with a uuid key, the order_by functionality breaks for the uuid column because the uuid is "not a valid order_by argument". Changing the constant django.db.models.sql.constants.ORDER_PATTERN by allowing a "-" from ORDER_PATTERN...
swe-bench_data_django__django-12671
Allow empty message in management command stdout and stderr proxies. Description Django management commands wrap stdout and stderr in an OutputWrapper that adds a \n at the end of the text provided as the out argument. I suggest allowing self.stdout.write() and self.stderr.write() to add a newline to respectively std...
swe-bench_data_django__django-12700
Settings are cleaned insufficiently. Description Posting publicly after checking with the rest of the security team. I just ran into a case where django.views.debug.SafeExceptionReporterFilter.get_safe_settings() would return several un-cleansed values. Looking at cleanse_setting() I realized that we ​only take care ...
swe-bench_data_django__django-12708
Migration crashes deleting an index_together if there is a unique_together on the same fields Description Happens with Django 1.11.10 Steps to reproduce: 1) Create models with 2 fields, add 2 same fields to unique_together and to index_together 2) Delete index_together -> Fail It will fail at django/db/backends/base/...
swe-bench_data_django__django-12713
Allow overridding widget in formfield_for_manytomany(). Description (last modified by Mariusz Felisiak) It does not work when I set widget param to function formfield_for_manytomany(). This is different from the formfield_for_foreignkey() function. diff --git a/django/contrib/admin/options.py b/django/contrib...
swe-bench_data_django__django-12733
Use PostgreSQL TRUNCATE … RESTART IDENTITY keyword to reset sequences in sql_flush() Description Rather than executing an additional query per truncated table, can truncate and reset sequences in a single query by using the RESTART IDENTITY syntax. My project uses the sql_flush() operation internally and profiling sh...
swe-bench_data_django__django-12734
Migration doesn't detect precision changes in fields that ManyToMany points to. Description In my case was: models.py: class Vulnerability(models.Model): cve_id = models.CharField(max_length=15, primary_key=True) app = models.ManyToManyField(AppVersion) class Meta: managed = True Later, i changed cve_id max_leng...
swe-bench_data_django__django-12741
Simplify signature of `DatabaseOperations.execute_sql_flush()` Description The current signature is: def execute_sql_flush(self, using, sql_list): The using argument can be dropped and inferred by the calling instance: self.connection.alias. def execute_sql_flush(self, sql_list): Some internal ises of this method are...
swe-bench_data_django__django-12747
QuerySet.Delete - inconsistent result when zero objects deleted Description The result format of the QuerySet.Delete method is a tuple: (X, Y) X - is the total amount of deleted objects (including foreign key deleted objects) Y - is a dictionary specifying counters of deleted objects for each specific model (the key...
swe-bench_data_django__django-12748
Add support to reset sequences on SQLite Description Can use the internal sqlite_sequence table: ​https://sqlite.org/fileformat2.html#seqtab diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/feat...
swe-bench_data_django__django-12754
FieldError when migrating field to new model subclass. Description Analogous to #21890. If creating a model subclass and moving a field onto it in the same step, makemigrations works but migrate dies with django.core.exceptions.FieldError: Local field 'title' in class 'Book' clashes with field of the same name from b...
swe-bench_data_django__django-12771
Store ModeState.fields into a dict. Description ModeState initially stored its fields into a List[Tuple[str, models.Field]] because ​it wanted to preserve ordering. However the auto-detector doesn't consider field re-ordering as a state change and Django doesn't support table column reordering in the first place. The...
swe-bench_data_django__django-12774
Allow QuerySet.in_bulk() for fields with total UniqueConstraints. Description If a field is unique by UniqueConstraint instead of unique=True running in_bulk() on that field will fail. Consider: class Article(models.Model): slug = models.CharField(max_length=255) class Meta: constraints = [ models.UniqueCons...
swe-bench_data_django__django-12796
Allow makemigrations to skip database consistency checks Description Currently makemigrations always requires an active database connection, due to it executing loader.check_consistent_history() here: ​https://github.com/django/django/blob/290d8471bba35980f3e228f9c171afc40f2550fa/django/core/management/commands/makem...
swe-bench_data_django__django-12803
ManifestFilesMixin.file_hash() returning None get's included in hashed filename as 'None'. Description (last modified by Mariusz Felisiak) When returning a string from a custom ManifestFilesMixin.file_hash() implementation, the resulting file name is <file_path>.<custom_hash>.<ext> as expected, whereas returnin...
swe-bench_data_django__django-12821
Stop minifying only some admin static assets Description Here is a list of JavaScript files in the admin app and their size: 20K django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js 15K django/contrib/admin/static/admin/js/inlines.js 13K django/contrib/admin/static/admin/js/SelectFilter2.js 8.8K django...
swe-bench_data_django__django-12830
Add an absolute_max parameter to formset_factory Description The documentation at ​https://docs.djangoproject.com/en/1.5/topics/forms/formsets/#limiting-the-maximum-number-of-forms seems to indicate (if I understood it correctly) that the purpose of the max_num parameter is to prevent that someone sends a manipulated...
swe-bench_data_django__django-12851
Remove ifequal from the template language. Description No modern project uses ifequal. No one recommends it. I argue it is taking up valuable bytes in the project. Let's remove it. diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py --- a/django/template/defaulttags.py +++ b/django/template...
swe-bench_data_django__django-12855
Deprecate django.conf.urls.url(). Description The docs for ​django.conf.urls.url say: This function is an alias to django.urls.re_path(). It’s likely to be deprecated in a future release. It looks like the change was made in this ​commit back in 2016 (Django 2.0). Given some years have passed, is it now the time to d...
swe-bench_data_django__django-12856
Add check for fields of UniqueConstraints. Description (last modified by Marnanel Thurman) When a model gains a UniqueConstraint, makemigrations doesn't check that the fields named therein actually exist. This is in contrast to the older unique_together syntax, which raises models.E012 if the fields don't exist...
swe-bench_data_django__django-12858
models.E015 is raised when ordering uses lookups that are not transforms. Description ./manage.py check SystemCheckError: System check identified some issues: ERRORS: app.Stock: (models.E015) 'ordering' refers to the nonexistent field, related field, or lookup 'supply__product__parent__isnull'. However this ordering ...