Skip to main content
0 votes
1 answer
149 views

I've set the widget on the MultipleChoiceField with: self.fields['field_1'] = forms.MultipleChoiceField( choices=[(c.name, str(c)) for c in customers], widget=forms....
Alex Totheroh's user avatar
1 vote
1 answer
838 views

We're using Django 1.4.22 and celery 3.1.25 with REDIS. The default value for visibility_timeout is one hour and it is too small for our jobs. How can we increase visibility_timeout to 6 hours? My ...
user3429660's user avatar
  • 2,752
0 votes
2 answers
1k views

I'm working on a Django(1.4) and Python (2.7) project in which I have a custom model for user to get loggedin. Here's my model: from models.py: class User_table(models.Model): first_name = ...
Abdul Rehman's user avatar
  • 5,704
0 votes
0 answers
52 views

Im trying to get a project working locally, however when I try and $python manage.py runserver I get the error: ImportError: No module named myproject.urls I am confident the project is set up ...
salty_coffee's user avatar
0 votes
0 answers
60 views

I have a Django project which has been set us using django-pipeline and django-compress. The code on github is pretty standard ex: {% extends "base.html" %} {% load static from staticfiles %} {% ...
salty_coffee's user avatar
0 votes
0 answers
341 views

I'm trying to run locally old Django 1.4 project which I have to upgrade and further develop. Everything is working fine on server. On my local I've got virtual environment set up using pip freeze ...
kazik's user avatar
  • 33
0 votes
1 answer
104 views

Let's say I query Workplaces in a City and prefetch all their Workers, which is a many-to-many relationship: workplaces = list(city.workerplace_set.filter(num_employees__lte=350).prefetch_related('...
dabadaba's user avatar
  • 9,572
1 vote
2 answers
2k views

I am trying to filter by a value calculated using aggregates. Currently I am doing this: max_val = some_queryset.aggregate(max_val=Max('some_prop'))['max_val'] some_queryset.filter(some_prop=max_val) ...
dabadaba's user avatar
  • 9,572
0 votes
1 answer
39 views

I had a huge registration table with 112 fields. For a particular search I want to compare 17 fields & assign colors to variable say 'clrSelected'. My code is : reg = Regisration.objects.filter('...
Adithya's user avatar
  • 1,907
12 votes
2 answers
15k views

I have a model I wish to filter by its attribute a. The model also has another attribute b. I am trying to filter entries where a is 0 or a has the value of the b attribute (for each row, obviously). ...
dabadaba's user avatar
  • 9,572
0 votes
1 answer
2k views

I am trying to define a decorator to check if the user has admin certain privileges: def admin_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): actual_decorator = ...
dabadaba's user avatar
  • 9,572
2 votes
1 answer
2k views

For a search function I want to save django query to database & later execute it. I have saved the query as shown below in one table(Company, which have id,qryText). The django query is saved as ...
Adithya's user avatar
  • 1,907
0 votes
1 answer
824 views

When tried to install any dependency with specific version using PIP I am getting following error: (myvenv) D:\Project\on-staging>pip install Fabric==1.4.3 Collecting Fabric==1.4.3 Using cached ...
NK_Mimrot's user avatar
  • 352
0 votes
2 answers
852 views

I am having an issue with the way Django class-based forms save a form. I am using a form.ModelForm for one of my models which has some many-to-many relationships. In the model's save method I check ...
dabadaba's user avatar
  • 9,572
0 votes
1 answer
3k views

I had an issue I just posted here. I saw an answer to a similar question which said uninstalling and installing requirements.txt would help because the root of the issue was a bad dependency chain. ...
dabadaba's user avatar
  • 9,572

15 30 50 per page
1
2 3 4 5
16