Questions tagged [django-1.4]

Django 1.4 is a version of the Django framework, released in March 2012, with enhanced time zones support and various other improvements. Please only use this tag if your question relates specifically to this version.

Django 1.4 is a version of the Django framework, released in March 2012, with enhanced time zones support and various other improvements. Please only use this tag if your question relates specifically to this version.

See the release notes for more details.

227 questions
0
votes
2 answers

Django: I want to connect about one-to-many

Django: I want to connect about one-to-many... What should I do? from django.db import models class Note(models.Model) content = models.CharField(max_length=20) class A(models.Model) name = models.CharField(max_length=20) addr =…
chobo
  • 4,830
  • 5
  • 23
  • 36
0
votes
1 answer

Error when submitting form

Possible Duplicate: Updating an entry on form submit instead of saving new entry I am editing the form and submitting it, but it is not getting updated, instead it is storing in another entry. def searchinventory2(request, id = None): print…
0
votes
2 answers

Creating a ModelForm to update a record in django 1.4

I am trying to create a ModelForm that updates a record in my database, but for some reason it isn't working. It turns out blank. What am I doing wrong here? this is my forms.py: class PageForm(ModelForm): class Meta: model = Page this…
0
votes
2 answers

How to pass form to Class-based generic views(TodayArchiveView)?

url.py from django.conf.urls import patterns, include, url import os.path from crm.views import * urlpatterns += patterns('', (r'^test/$', tView.as_view()), ) views.py from django.views.generic import TodayArchiveView from crm.forms import…
chobo
  • 4,830
  • 5
  • 23
  • 36
0
votes
2 answers

Django AutoSlugField across inherited models

I'm wondering if you can have slugs unique across inherited models? I have three models, one base and two that extend it. The base has a unique AutoSlugField that is generated from the name field. The slug is on the BaseModel however if I save a…
rockingskier
  • 9,066
  • 3
  • 40
  • 49
0
votes
0 answers

Django 1.4: admin not using STATIC_URL

I've upgrade my Django from 1.3 to 1.4, and using django.contrib.staticfiles. I have to change the ADMIN_MEDIA_PREFIX to only use STATIC_URL, wich is defined as STATIC_URL = '/static/' When I open the admin interface, css files are linked to…
adrianlzt
  • 1,862
  • 20
  • 11
0
votes
0 answers

Django - changes in url after facebook login redirect

I'm doing a server-side login into facebook, after successful login a user is redirected to the right place and everything, but the url has a number of special signs at the end. Here is my login function: def fb_login(request): args =…
Neara
  • 3,693
  • 7
  • 29
  • 40
0
votes
2 answers

using datetime.utcnow() with DjangoTables2 render_FOO

I am trying to display the age of a post(in hours) with djangotables2. My code is given below class PostTable(tables.Table): current_Time = datetime.utcnow().replace(tzinfo=utc) published= tables.Column() def render_published(self,…
Jose Cherian
  • 7,207
  • 3
  • 36
  • 39
0
votes
2 answers

Django url template tag {% url %} error on django 1.4

I made this many times and it worked, but not this time. I get this error when I try to use {% url path.to.view %} django's template tage: AttributeError at /login/ 'str' object has no attribute 'regex' urls.py (main) urlpatterns= patterns('',…
securecurve
  • 5,589
  • 5
  • 45
  • 80
0
votes
2 answers

Django 1.4 Settings file questions?

I've used Django 1.3 for some time, and now that my system updated django automatically to 1.4, I'm facing a problem with a settings file. Problem 1: I have created new project with command django-admin.py startproject tutorial Django automatically…
Zed
  • 5,683
  • 11
  • 49
  • 81
0
votes
1 answer

How to have an Autofield value of a model as a custom ModelForm field

In a custom ModelForm, I would like to have a HiddenInput field which has the value of the Autofield primary key of the model. If the form is created without a model, then this field would be None. If a model is provided to instantiate the form, it…
emispowder
  • 1,787
  • 19
  • 21
0
votes
1 answer

Accessing request context in template without view - django

I have the following view that displays the user profile: @login_required def user_profile(request): return render_to_response('registration/profile.html',context_instance=RequestContext(request)) I access the user information through the…
AlexBrand
  • 11,971
  • 20
  • 87
  • 132
0
votes
1 answer

Django 1.4 static file not found error

Possible Duplicate: Trying to serve django static files on development server - not found I just entered the world of Python and django, i am unable to set my URL using the STATIC_URL , i am currently developing locally with django 1.4. I read…
shabeer90
  • 5,161
  • 4
  • 47
  • 65
0
votes
1 answer

Edit form not loading a form value

I have an edit view for one of my models. @login_required def edit(request, id): ''' Edit form ''' if id: post = get_object_or_404(Post, pk=id) if post.user != request.user: return HttpResponseForbidden() …
AlexBrand
  • 11,971
  • 20
  • 87
  • 132
0
votes
1 answer

Django 1.4 "LOGGING" variable in settings.py seems to be ignored

I've got a module I want to log in Django that looks something like this: import logging logger = logging.getLogger(__name__) def foo(): #this is a test of logging logger.info("info foo") logger.warning("warn foo") …
Ian Burnette
  • 1,020
  • 10
  • 16