Questions tagged [django-1.11]

Django 1.11 is a version of the Django framework, released April 2017. It is a Long Term Support (LTS) release, and will be supported until at least April 2020. Please only use this tag if your question relates specifically to this version.

Django 1.11 requires Python 3.4, 3.5, or 3.6. It is the last version of Django to support Python 2.

Here are some of the salient features of Django 1.11:

Django-1.11 was released in April 2017 as a long-term support release and will be supported until April 2020.

324 questions
2
votes
0 answers

How to replace LocaleRegexURLResolver from django 1.11

I am currently upgrading Django from 1.11 to 2.0 (to 2.2 in the long run). But recently I bumped into a problem which a can't solve for quiet some time. LocaleRegexURLResolver has been removed in 2.0 without any warning and the whole code has been…
Petr Kučera
  • 78
  • 11
2
votes
2 answers

Check if object_id occurs more than once in queryset.annotate Case When parameter

Documentation field look up doesn't really help in my case What my query looks like now date_delta = 2 queryset = TrendData.objects.filter(owner__trend_type__mnemonic='posts', date_trend__date__range=[date_from, date_to]).values('owner_id',…
nexla
  • 434
  • 7
  • 20
2
votes
1 answer

Issue with duplicate values generated when using factory_boy and randint

I'm seeing duplicate values being generated when using randint and factory_boy. My test fails when checking for the asset for each object. The barcode is also the same between the two when calling create() on the factory. Do I need to provide a…
Aero Chocolate
  • 1,477
  • 6
  • 23
  • 39
2
votes
1 answer

"OperationalError: no such table: django_site" when running makemigrations with empty database when using Django-todo

I have inherited a Django 1.11.6 application from another developer. Now after I have made a lot of changes to the code and data model, I want to re-create the sqlite database from scratch. But when I run manage.py makemigrations in the project…
saxum
  • 107
  • 2
  • 10
2
votes
1 answer

Exporting using django-import-export and showing verbose names of related objects

I was having a look at the following library - django-import-export. However, I am having issues with exporting with friendly/verbose column names for related objects. Related link:…
Aero Chocolate
  • 1,477
  • 6
  • 23
  • 39
2
votes
0 answers

Django: how to re-create correct migrations for existing database?

I have existing database and no migrations files (which was lost for some reasons). I have some new models, which are not correspond to existing database, some tables are altered in comparison with existing database. I'd like to synchronize db and…
john.don83
  • 103
  • 1
  • 10
2
votes
1 answer

Enforcing model limit in GenericForeignKey

I'm have a simple model using a GenericForeignKey object. I would like to limit the allowed content_objects to a specific, static set of models. Lets say, I would only like it to accept ModelA and ModelB from app_a and app_b, respectively. I ran…
rob
  • 2,119
  • 1
  • 22
  • 41
2
votes
1 answer

Django filter by the number of rows matching a certain condition in a ManyToMany

I need to filter for objects where the number of elements in a ManyToMany relationship matches a condition. Here's some simplified models: Place(models.Model): name = models.CharField(max_length=100) Person(models.Model): type =…
Clockwork
  • 53
  • 7
2
votes
1 answer

django : makemigrations process does not end

when i run python manage.py makemigrations and migrate every thing is ok and changes are made but process does not end and I must press control+z to end process why this happend?? is it normal? db backend : mysql python 2.7 django 1.11 OS: ubuntu…
2
votes
1 answer

Django 1.11 querysets: Get all objects (model instances) of a relationship set

If have a model for companies. These companies have an attribute employment_set, because workers are assigned to companies via the employment relation. How can I query all employees for a given company? The model for the employements look like…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
2
votes
2 answers

TypeError: view must be a callable or a list/tuple when including another urls.py

I’ve read carefully the several other questions that cover this topic, however, none depict the case of include() (including another urls.py file). I’ve also looked at 1.11 documentation here and coded in accordance, however, I continually get the…
RigidBody
  • 656
  • 3
  • 11
  • 26
2
votes
1 answer

Django Rest Framework updating nested m2m objects. Does anyone know a better way?

I have a case when user needs to update one instance together with adding/editing the m2m related objects on this instance. Here is my solution: # models.py class AdditionalAction(SoftDeletionModel): ADDITIONAL_CHOICES = ( ('to_bring',…
Feanor
  • 3,568
  • 5
  • 29
  • 49
2
votes
1 answer

manage.py file showing invalid syntax error

My application was running fine when I was running it on my local machine. But, as soon as I uploaded it on a server , manage.py is giving the following error - File "manage.py", line 14 ) from exc ^ SyntaxError: invalid…
TeeKay
  • 1,025
  • 2
  • 22
  • 60
2
votes
1 answer

Passing data from django form to ListView

Above is an image of what I am attempting to build: A form that is at the top while the area to display a result list is below. When I hit 'Go!', the part below does not render the list as I hoped. Also, I am not sure if this is the 'proper' way to…
2
votes
1 answer

Boolean annotation resulting in duplicates?

I am trying to implement a basic 'favourites' system based on a foreign key table. Let's say I have the following simple models: class Item(models.Model) id = models.IntegerField() class User(models.Model) id = models.IntegerField() class…
Eric
  • 601
  • 7
  • 22