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
3
votes
2 answers

Django get() takes exactly 2 arguments (3 given)

I am trying to use DetailView generic class in my test app and this is what I have in my view *updated model * from this example class AuthorDetailView(DetailView): context_object_name = "author" queryset = Author.objects.all() …
iJK
  • 4,655
  • 12
  • 63
  • 95
3
votes
2 answers

blank=False,null=False not working in models code Django

class Url(models.Model): url=models.URLField(verify_exists=True,max_length=200,blank=False,null=False) date=models.DateTimeField(auto_now_add=True) count=models.IntegerField(default=0) isspam=models.IntegerField(default=0) This is…
Dhiraj Thakur
  • 716
  • 10
  • 25
3
votes
1 answer

Django: `model.fk_id` isn't updated after `model.fk.save()`?

I've got a model which, when saved, should create and save one of its foreign keys if it doesn't already exist: class MyModel(m.Model): fk = m.ForeignKey(AnotherModel) def save(self): if not self.fk_id: self.fk =…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
2
votes
2 answers

Best way to merge duplicates in Django 1.3?

I have found this code http://djangosnippets.org/snippets/2283/ but I think it doesn't work with manytomanyfields which use another model (keyword through) - I get an AttributeError when trying to merge. Do you know any way to fix this or another…
Weier
  • 1,339
  • 1
  • 10
  • 20
2
votes
2 answers

dependent fields in django admin

I want to add, some fields depending on others. I have city and country model. I can include country as foreign key in city model. And then if I will add both city and country in another model ( say content) then will it be just like dependent…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
2
votes
1 answer

Monday as first day of week for WeekArchiveView

How do I convince WeekArchiveView that Monday is the first day of week?
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
2
votes
1 answer

How do I display most recent week items by default with WeekArchiveView?

I'm astonished by how little documentation on class-based generic views there is. Anything slightly more complex than a trivial sample has to get done through guesswork, trial and error. I want to use WeekArchiveView to display a week's item list. …
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
2
votes
0 answers

Why can't field be added to ModelForm in __init__() in Django 1.3

I have a ModelForm with a dynamically added field. It stopped working when I switched from Django 1.2 to Django 1.3. The following code is a minimal version which recreates the issue. class MyModel(models.Model): rank = models.IntegerField() …
JivanAmara
  • 1,065
  • 2
  • 10
  • 20
2
votes
2 answers

Adding Dynamic elements to logging.filters in django 1.3

I'm attempting to add some contextual information to some logs via the logging module. I need to be able to view a projectid next to each line in the logs, with over 20,000 projects created daily this data is really helpful. To do this I've created…
Mark Walker
  • 33
  • 1
  • 5
2
votes
3 answers

Is there a way to install Django 1.2 and 1.3 side by side?

I need to use Django 1.2 for one of my projects. I also already have several projects running on Django 1.3 on the same server, and I need to keep them running. Is there a way to only use 1.2 for a specific project? Both sites run on Apache via…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
2
votes
1 answer

Django 1.3 testing without recreating database / loading fixtures for every run of the test

I'm using django 1.3 and writing some selenium test & django unit tests. I want to know if its possible to run the tests without creating the databases & loading fixtures everytime? I stumbled upon this SO thread which gives a good way to test…
2
votes
1 answer

Add a function as a field to a model in Django/Python

Models class A(SiteAwareModel): name = models.CharField(max_length = 255, blank = False) description = models.TextField(blank = True, null = True) class Meta: def key_count(self): return…
2
votes
2 answers

Filtering for multiple ForeignKey matches using Q objects

I've initialized these models with the following data in an app named main under Django 1.3: from django.db.models import Model, FloatField, CharField, ForeignKey, Q class Customer(Model): name = CharField(max_length=64) class Order(Model): …
Jeremy
  • 1
  • 85
  • 340
  • 366
2
votes
1 answer

Function-based generic views have been deprecated

DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead. I keep getting this warning, when I'm running my site. What does this mean and how can I fix it?
anc1revv
  • 1,563
  • 7
  • 24
  • 42
2
votes
2 answers

Django 1.4 deprecates ADMIN_MEDIA_PREFIX but my project was started using Django 1.3 so having issue while using in Django 1.4

I started a project in Django 1.3 and have recently installed Django 1.4 on another machine and continued my project on Django 1.4. Django 1.4 deprecated the ADMIN_MEDIA_PREFIX setting so I removed it, but now there is some other error that…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
1 2
3
8 9