Questions tagged [django-1.3]

Django 1.3 is a version of the Django framework, released in March 2011. Please only use this tag if your question relates specifically to this version.

Django 1.3 is a version of Django framework, released in March 2011. Please only use this tag if your question relates specifically to this version.

See the release notes for more details.

135 questions
0
votes
1 answer

How to convert modelchoicefield to charfield in django admin?

This is my sample model: class Booking(models.Model): email = models.EmailField(unique=True) first_name = models.CharField(max_length=256) last_name = models.CharField(max_length=256) class MailList(models.Model): email =…
user683742
  • 80
  • 2
  • 8
0
votes
1 answer

Update a count variable in model object

What I want to do is simple I want to update the count variable of the object every time my view function is called. My models is like this: class Url(models.Model): #some vars here count=0 def __unicode__(self): …
Dhiraj Thakur
  • 716
  • 10
  • 25
0
votes
2 answers

Change site address http://127.0.0.1:8000/ to something like http://www.google.com

How can i change the default address http://127.0.0.1:8000/ to something useful like a proper sitename. I am using the development server that comes with Django. I googled for about 1 hour but could not find a proper solution.I am a beginner so…
Dhiraj Thakur
  • 716
  • 10
  • 25
0
votes
1 answer

how to override django admin form Foreignkey based on request.user

admin.py class PromoAdmin(admin.modelAdmin) list_display = ( 'name', 'id', 'category', 'promo_type', 'store', 'brand', 'date_start' ) form = SampleForm forms.py class SampleForm(forms.ModelForm): class Meta: model = Promo def…
user683742
  • 80
  • 2
  • 8
0
votes
1 answer

Pre-Fetching one-to-many records in Django 1.3.1

I am looping over a queryset and fetching a one-to-many field. Now, for each call there is a query that is being fired. Django 1.4 has prefetch_related. How can I do something similar with Django 1.3.1 ?
Aman
  • 4,786
  • 1
  • 17
  • 17
0
votes
3 answers

django-admin.py startapp myproject does not create settings.py

I have Python2.7 and Django 1.3.1, running on windows 7 32bit When I type 'python django-admin.py startapp myproject', the folder that is created looks like: mysite/ init.py models.py tests.py views.py instead of mysite/ …
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
0
votes
1 answer

Is there an alternative to raw sql query?

I have following models setup in Django 1.3. I have School and Teacher with many-to-many relationship. class Teacher(models.Model): schools = models.ManyToManyField(School, db_table="schoolteachers", related_name='scteachers') Now, I have a…
John
  • 3,821
  • 2
  • 18
  • 25
0
votes
1 answer

error overiding save method while extending Django-registration app

I am using django-registration app. and have following code in forms.py from django.contrib.auth.forms import UserCreationForm from registration.forms import RegistrationFormUniqueEmail from django import forms from django.contrib.auth.models…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
0
votes
1 answer

@login_requred decorator for authentication using mongoengine in django

I am new to mongoengine I wanted to use @login_required decorator for checking whether user is logged in or not. I used following code : ''' from django.contrib.auth.decorators import login_required @login_required(login_url='/loginpage') def…
0
votes
2 answers

How to detect the file size of a video before you upload it?

I have been asking questions about this subject a lot recently. i created my upload form models.py from django.db import models from app.extra import ContentTypeRestrictedFileField class upload(models.Model): """ upload """ name =…
user
  • 973
  • 4
  • 14
  • 29
0
votes
1 answer

request is not available for conditions in URL patterns in django

I am conditionally using two different url patterns, mean on one URL I am conditionally checking usertype and then making URL pattern accordingly.Following is what that is in my urls.py from django.conf.urls.defaults import * from project import…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
0
votes
1 answer

Assigning datetime to models.DateTimeField seems to drop the time

I was writing a unittest and noticed that I couldn't assign a datetime object to the models.DateTimeField without loosing the time details. I.e: class Foo(models.Model): created = models.DateTimeField( editable=False) my_time =…
Kit Sunde
  • 35,972
  • 25
  • 125
  • 179
-1
votes
1 answer

django form version 1.3

I want to have a user submitted form in a certain page. My model is like this class Ask(models.Model): name = models.CharField(max_length=500) designation = models.CharField(max_length=200, blank=True) email = models.EmailField() …
themunna
  • 47
  • 1
  • 6
-1
votes
1 answer

Switch Case in Django Template

I'm trying to put different template for different category based on category ID. I'm using Django 1.3. Switch case is not working with Django 1.3, I get this error: Invalid block tag: 'switch', expected 'endblock' or 'endblock content' but switch…
shiva sankar
  • 61
  • 1
  • 9
-1
votes
1 answer

django/south : redundant add_column?

I made a change, adding a unique constraint to a model, within the abc application and did a ./manage.py schemamigration abc --auto That created a migration file but as well as the expected change the new migration file also contained a number of…
glaucon
  • 8,112
  • 9
  • 41
  • 63
1 2 3
8
9