0
votes
0answers
19 views
Django forms. Create instance of foreign key on the fly.
I have two classes, one of which has the other as a ForeignKey. The first class is DeliveryLocation, and the second class is Purchase. DeliveryLocation has two variables, city and zip. I want to make ...
0
votes
0answers
23 views
Loop in django app - check if object already created
i have problem with django app:
class Module(models.Model):
requirements = models.ManyToManyField("self", related_name='wym', symmetrical=False)
status = ''
class EndedModules(models.Model):
...
0
votes
0answers
7 views
Heroku one request spawns two responses that crashes my app
In my Heroku Django app, for the user account registration flow, there is a typical request activate account that happens when the user receives an email with a special "activate" URL. In the app, ...
-4
votes
0answers
10 views
How to call a function in Django template without refresh the page?
The case is, I want to make something similar with this example using Django:
http://www.flotcharts.org/flot/examples/realtime/index.html
I generated some data using scipy and want to plot it on a ...
0
votes
2answers
16 views
How do I make a class a sub-group of another class?
from django.db import models
class products(models.Model): #Table name, has to wrap models.Model to get the functionality of Django.
name = models.CharField(max_length=200, unique=True) ...
0
votes
2answers
27 views
Django — Allowing Users To Only View Their Own Page
I am nearing what I think is the end of development for a Django application I'm building. The key view in this application is a user dashboard to display metrics of some kind. Basically I don't want ...
2
votes
2answers
29 views
Checking for permission in django template not working
I want to verify user permission in template. If a user has permission he/she will be able to access the template. After writing the below code and I granted the user permission, when I view the page ...
0
votes
0answers
27 views
Some problems with Paginator
I'm new in python and django, so i'm sorry for the stupid question...:)
This is in views.py
def attore(request, id):
attore = get_object_or_404( Attore, pk=id )
# return ...
1
vote
3answers
34 views
Unable to update CharField - Django
First of all I'm glad to be here, I read you lately and i found useful answers here.
This is my first post so please be kind with me, I'm a newbie in programming.
So, I'm writing my 1st web ...
0
votes
0answers
18 views
In Python, does DummyThread uniquely identify the current thread?
I've been trying to use multithreading in my GoogleAppEngine Python application.
Some background:
I use Django for templating, using a custom template loader. The first time a template is passed to ...
0
votes
0answers
15 views
Django order by manytomany field using custom method
How can I get all services ordered by discount__value where discount.is_active()?
models.py
class Service(models.Model):
name = models.CharField(max_length=50)
length = models.IntegerField()
...
1
vote
2answers
31 views
What is an Efficient Way to do an AND/OR Search Django-Postgres App?
In my Django app I have a Publication model and a Tag model which have a many to many relationship.
Let's say I have four tags: men, women, fashion, design. I want to find all publications that have ...
0
votes
3answers
41 views
TypeError: cannot concatenate 'str' and 'long' objects [duplicate]
the following code:
data = {"url": 'http://test.com/unsub/' + request.user.pk}
print(data)
Gives me this error:
TypeError: cannot concatenate 'str' and 'long' objects
Unsure why?
-4
votes
1answer
62 views
django:invalid syntax in try/except
i cant hack this error
invalid syntax (views.py, line 35)
actually my view is this
@login_required(login_url='/accounts/purchase/signin')
def item_add(request):
try:
if ...
0
votes
1answer
33 views
getting error while reading config file in django settings
I have this in my settings
import ConfigParser
parser = ConfigParser.ConfigParser()
parser.read('parameters.ini')
database_name = parser.get('database', 'myname')
i want to get the parameters ...