Questions tagged [django-1.10]

Django 1.10 is a version of the Django framework, released August 2016. Please only use this tag if your question relates specifically to this version.

Django 1.10 requires Python 2.7, 3.4, or 3.5.

Here are a list of changes:

Django 1.10 was released in August 2016 and was supported until December 2017.

191 questions
0
votes
1 answer

Django - How to add sender-name in Email?

What I am trying to achieve is having the senders-name, from the current logged in user with the association name, to show up in the receivers inbox like so: 'associaton-name'@domain.com I have commented it down below where i tried to achieve it in…
Niknak
  • 583
  • 1
  • 8
  • 22
0
votes
2 answers

Load image dont work in django-ckeditor?

I am tring to use django-ckeditor app to my TextField. I want to load image from computer but there is no load button. Also I cant enter url of picture. Whats wrong I did? How to fix this problem. Here below you can see want I did. 1) I add ckeditor…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

Problems with save ManyToMany field data

I have modal with 2 ManyToManyField. I have problems when try to save my form. Why save_m2m() method dont work? As you see in my form for function field I use ModelChoiceField and for program field I use ModelMultipleChoiceField. modals.py: class…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

How combine (merge) several number of querysets?

Can someone say how to combine (merge) several number of querysets. The number of querysets are not fixed. I tried next code but it didnt work as I expected. How to fix this problem? first_list = [] for id in ids: products =…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

How save marks in checkboxs?

Can someone say, how create such form as in the picture below in Django? I have model Product with field is_visable. In form I want to show all products with field is_visable. User can select checkboxes and change the value of is_visable field. In…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

Optimization for comparing every element of a list to every element in database using Django

I'm working on a project in Django 1.10, and one of my apps requires that I import a list of 500-100,000 IP addresses, then compare those 500-100,000 IP addresses to the ~25,000+ IP addresses stored in my SQLite3 database. Unfortunately, this takes…
B Jop
  • 3
  • 3
0
votes
1 answer

Why the contents of the form changes?

I am tring to create dynamic list to choicesof symbol field. I create that list inside view then put it to form constructor. I want to take all data from Dictionary modal put it inside choices and show in my form but in the same time I dont need to…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
2 answers

How in template show button if object is empty?

Can someone say where I did mistake? I have 2 models: Project and Purpose. class Purpose(models.Model): code = models.UUIDField(_('Code'), primary_key=True, default=uuid.uuid4, editable=False) project = models.ForeignKey(Project,…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

How to show in template current users role in project?

Can someone say where I did mistake? I have Project model. Every project has members. I have project_detail page where I want to show current user's username and his role in project. Right know in template it shows me only current user's username…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

django-reversion didnt work with MultipleChoiceField?

I have form with MultipleChoiceField. It shows me data from tuple CHOICES. Users select checkboxes and then I use that selected data to create new objects (in my case requirements) inside view. When I try to use django-reversion in my view it raise…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

Show in template number of new objects?

I have task but dont know how to realise it. Any help would be appreciated! In my django project I have modal "Task". Any task has a lot of comments. Here below you can see my code. I need to show number of new comments when user open the page. For…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

Associate comments with an already authorized user?

My task is to create comment system in django project. I am tring to use django-comments-xtd app. I successfully added this app to my project and use {% render_comment_form for object %} in template. Is shows me fields like "Name", "Email", "Url"…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
3 answers

Trying to override Django User model username validation

I am trying to override the django default User model username field to allow hashtags in usernames. I know the model itself will let me do this but the standard form registration doesn't seem to allow it. I'm using django-allauth as well. How do I…
Jason
  • 72
  • 7
0
votes
0 answers

select_for_update blocks forever

When I use select_for_update on a particular key, the call never returns. A regular select works: MyModel.objects.get(pk=pk_1) # Works But select_for_update doesn't: with transaction.atomic(): MyModel.objects.select_for_update().get(pk=pk_1) #…
Flash
  • 15,945
  • 13
  • 70
  • 98
0
votes
1 answer

Returning empty queryset in Django managers

How do you return an empty queryset in a Django manager? class EventDateRangeManager(models.Manager): def occurring_in_day(self, year, month, day): try: picked_date = datetime.date(int(year), int(month), int(day)) …
Algorithmatic
  • 1,824
  • 2
  • 24
  • 41