django

ImportError: Model A references Model B, Model B references Model A

Hello guys, I think this is more a python question than Django. But basically I'm doing at Model A: from myproject.modelb.models import ModelB and at Model B: from myproject.modela.models import ModelA Result: cannot import name ModelA Am I doing something forbidden? Thanks ...

django-grappelli and rare lot of errors

I'm using Django-grappelli in my project, but Django is send me a lot of errors to my email about some files that Django didn't found...but I don't know from where is calling this files...some time files .aspx (??) Here is a image with the error list in my inbox Here is a error detail: Traceback (most recent call last): File "/home...

Why would a Django admin site limited to 301 entries?

I'm working on a Google App Engine project using Django. I noticed that for some reason, the Django administration system page lists only 301 entities for one model, and 301 entities for another model. But there are actually over 500 stored instances for both of these models. What could be causing this problem? ...

Django InlineModelAdmin: Show partially an inline model and link to the complete model

Hi everybody I defined several models: Journals, volumes, volume_scanInfo etc. A journal can have more volumes and a volume can have more scanInfo. What I want to do is: in the admin page of journals I want to have the list of the volumes inline (done) connect each volume of the previous list to its admin page where I can show the fo...

Can someone help clarify my confusion about syncdb and import loops, 'Do you have to be explicit on imports?'

I have been having a difficult time building the database with syncdb on Python2.5. I think that some of this issue is because of the use of wildcard* for importing forum.models it seems to be creating a loop. >>> import settings >>> from forum.managers import QuestionManager, TagManager, AnswerManager, VoteManager, FlaggedItemManager...

django: more complicated filter

I have these models: class A(Model): pass class B(Model): a = ForeignKey(A) class C(Model): b = ForeignKey(B) I have an instance of A called mya. I want to find all B's for my A, for which there is at least one C. I can do this in one line: bsiwant = [c.b for c in C.objects.filter(b__a==mya)] (and uniquify it somehow) ...

Django: How can you validate a model if the __init__() just raises errors as soon as you feed it data?

Let's say I have a CarModel(models.Model) that uses price = models.DecimalField(): import CarModel car = CarModel(name='Corvette', price='Hello World') Traceback (most recent call last): ... ValidationError: 'price needs to be a Decimal()' The error was basically that. Since the price was expecting a decimal but received a string, i...

Interacting with a verified location? - Google Maps

Ok so there are loads of Businesses marked on Google Maps these days. But I cannot interact with these in any way. This is the information I have: venue name: Ministry of Sound address: 103 Gaunt Street London, SE1 6DP Google's Geolocation only gives me Coordinates (lat, long) Formatted Address I want an application ...

Django filters - Using an AllValuesFilter (with a LinkWidget) on a ManyToManyField

This is my first Stack Overflow question, so please let me know if I do anything wrong. I wish to create an AllValues filter on a ManyToMany field using the wonderful django-filters application. Basically, I want to create a filter that looks like it does in the Admin, so I also want to use the LinkWidget too. Unfortunately, I get an...

django - how to save form (not a modelForm)

Hi there, probably a silly question, but I'm not sure how to handle this 'correct'. I got a normal form with some fields. I can insert data without problems. When I want to edit a record, I'm using the "model_to_dict"-function to populate the form. After editing a record I want so save it, and here my problems starts. The django docs s...

Better web framework?

I come from a desktop programming background. I wanted to dive seriously into the web programming scene. I looked around and I think using a well established web framework would be the way to go. From what I see Django and Ruby on Rails are really popular. So I just wanted to know which of these or any other is a good choice for me. so...

Django: Redirect to current article after comment post

Hi, I am trying to use comments application in my project. I tried to use code ({% render_comment_form for event %}), shown in the documentation here: Django comments And the question is how to make the form redirect to the same page, after the submission. Also the big question is: Currently if we have any error found in the for, t...

What's the best solution for OpenID with Django?

There are at least half a dozen Django apps that provide OpenID authentication for Django: django-openid django-openid-auth another django-openid-auth, which seems to be dead django-authopenid django-socialauth (which also provides authentication with Twitter and Facebook accounts) django-socialregistration (has Facebook and Twitter au...

Django: ForeignKey() or ManyToMany() in this case? Or, other?

I have a model that is something like this: class ReturnAuthorization(models.Model): custom_id = models.CharField(max_length=40) class RMAAPILog(models.Model): return_authorization = models.ForeignKey(ReturnAuthorization) If I were to delete() a return authorization, I can't have it delete all the RMAAPILog()s that are relate...

jQuery problem with .appendTo and ie?

Im not sure if this is an issue with .appendTo() or the way im using it, I've gone over the docs in the api several times now and its still unclear so I figured I would turn it over to the handsome geniuses at SO. I am trying to move some error li's generated by django and everything works fine so far in firefox however when the followi...

Having "Exception Value: The _imaging C module is not installed" with my Buildout/Python/Django/PIL on Mac OSX SL?

Hello there. I'm using Buildout for my Django projects, with FeinCMS. I've got it setup great locally on my Mac OSX Snow Leopard, with no errors coming up at all when I use runserver. But when I upload an image with FeinCMS in the admin area it comes up with a "Exception Value: The _imaging C module is not installed" error. My tracebac...

Enabling overriding of app template in django?

I'm writing a simple site to display statistics for some data, and I've got an app called "stats", that I'd like to write default templates for (places in stats/templates/stats), but I'd like these to be overridable in the same way that the templates for the admin app are. IE: If I put a stats/view.html in my project's templates directo...

Django: How to dynamically load different urlconfs?

What I'm trying to do: # urls.py urlpatterns = patterns('', (r'^info/(?P<user>[-\w+])/(?P<app>[-\w+])/', include(%app%.urls)), ) which should display specific information that given user entered for the app. And I want the URL scheme to stay this way. Is it even possible? I think namespaces would do the trick but official document...

How can I see error logs of Django views

I'm coding a small application with Django. But I can't see any error logs in the console when an error (e.g. Python syntax error, etc.) occurs in one of my views -no action at all. How can I see the error logs of my views? Debugging like a blind is really annoying. ...

Django can't syncdb after drop/create database

I wanted to reset a database and issued a drop database followed by a create database on a postgresql server accessed through psycopg2 by a django app. When I do ./manage.py syncdb I get the following error: (prod)root@ns204612:/home/someproject/prod/django-mingus/mingus# ./manage.py syncdb Traceback (most recent call last): File "./...