django

Is there a way to customize how a field looks in the results list?

Is there a way to customize the way a field is displayed in the django admin results list? For example, I'd like to display an image based on the field value, just like boolean fields are displayed using an image rather than text value. ...

Django MultiValueField - How to pass choices to ChoiceField?

I have a multivaluefield with a charfield and choicefield. I need to pass choices to the choicefield constructor, however when I try to pass it into my custom multivaluefield I get an error __init__() got an unexpected keyword argument 'choices'. I know the rest of the code works because when I remove the choices keyword argument from ...

Non-repeatable django problem: Error was: 'module' object has no attribute 'validators'

Hi! I'm using dango 0.97 pre (yep, my site still was not upgraded to be compatible with trunk). I use apache + fastcgi for it. And I have a strange problem: sometimes (I can't guess the order) some of the views throw such error: Tried audio_index in module mysite.audio.views. Error was: 'module' object has no attribute 'validators' Th...

Disable link to edit object in django's admin (display list only)?

In Django's admin, I want disable the links provided on the "select item to change" page so that users cannot go anywhere to edit the item. (I am going to limit what the users can do with this list to a set of drop down actions - no actual editing of fields). I see that Django has the ability to choose which fields display the link, ho...

Mapping complex python objects to django models

I have a certain class structure in my app, that currently utilizes django for presentation. I was not using the model layer at all, - the database interaction routines are hand-written. I am, however, considering the possibility of actually using django to its full potential and actually using the database-abstraction layer. The quest...

python locale currency and negative numbers

Why? C:\path\>manage.py shell Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getlocale() ('Spanish_Colombia', '1252') >>> locale.currency( 1885, grouping=True ) '$ 1.885,00' >>> locale.currency...

How to start a long running process from Django view?

What I need to do is run a process that might take hours to complete from a Django view. I don't need to the state or communicate with it but I need that view to redirect away right after starting the process. I've tried using subprocess.Popen, using it within a new threading.Thread, multiprocessing.Process - parent process keeps hangin...

Using Python Regular Expression in Django.

I have an web address: http://www.example.com/org/companyA I want to be able to pass CompanyA to a view using regular expressions. This is what I have: (r'^org/?P<company_name>\w+/$',"orgman.views.orgman") and it doesn't match. Ideally all URL's that look like example.com/org/X would pass x to the view. Thanks in advance! ...

In Django, how to clear all the memcached keys and values?

I don't want to restart the memcached server! ...

In Django, how can I embed something in CSS?

background: url({{ MEDIA_URL }}/bg.jpg); That does not work, because this Django template function only works in .html! ...

Installing satchmo without ssh access

Hi I want to install satchmo in my virtual hosting, but they dont provide ssh access for it. I want to know if it is possible. As i can see, adding some Satchmo requirements(http://www.satchmoproject.com/docs/svn/requirements.html) to pythonpath in my .fcgi file seems to be working, but some requirements like pycrypto and trml2pdf look ...

queryset.exists() doesn't work correctly or I don't understand something?

I don't understand is it normal or it's time to create new django's ticket? In [17]: User.objects.filter(pk=0) Out[17]: [] In [18]: User.objects.filter(pk=0).exists() Out[18]: True The exists() should return False result in this case, I think. This is revision 11653 (Development version) I have related problem with unique validating...

Django: Photologue does not show images in templates

I am trying to install django-photologue. Everything seems ok, because I install and set up following the official guidelines. I have to upload some photos as examples. However, when viewing a photo or gallery details , then an error as follows: Caught an exception while rendering: 'Photo' object has no attribute 'get_thumbnail_url' I...

Enable sluggified URLs in Django

I am trying to enable sluggified URLs in Django of the form that SO uses: example.com/id/slug. I have no problem enabling slugs, and have URLs currently set up of the form: http://127.0.0.1:8000/articles/id/ (eg. /articles/1/) and that works fine. The corresponding URLpattern is: (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_de...

dynamic django form

I am trying to use the dynamic django form script from http://www.djangosnippets.org/snippets/714/ The dynamic form is generated, but I am having hard time retrieving submitted fields through form.cleaned_data['myfield'] There are few comments on the snippet page, those didn't work either. ...

404 Error messages in django

I have a project that I am working on in django. There are a lot of instances where I: raise Http404("this is an error") and it creates a nice 404 page for me with the error message "this is an error" written on it. I now want to create a custom error page and have it still display the message, but I can't figure out how. I'm sure it'...

Eclipse Django Plugin

Is there an Eclipse plugin to help with Django projects/apps? If there are multiple choices, what is your recommendation? ...

About IP 0.0.0.0(django)

Hi All: I've got a server and we run a django powered site. Since we want to test the site, so we use django's build-in development server(i.e runserver). But I'm curious about the ip of the command: python manage.py runserver 0.0.0.0:80 Then we can visit the test site using server's ip remotely. But when I try: python manage.py run...

Cappuccino, Django, AJAX, and fitting it all together - review my architecture!

I'm trying to get my head around Cappuccino. I'd like my StackOverview peers to review the architecture below and see if it makes sense - the aim is to utilize the unique benefits of Django and Cappuccino without doubling up where the technologies overlap... When the web browser requests a 'friendly' URL (eg, /, /articles, etc): DJang...

Define an attribute in a model, like an object of the other model in Django

Is posible to define an attribute in a data model like an object of other data model in Django? This is the scenary: models.py class Inmueble(models.Model): calle = models.CharField(max_length=20, verbose_name="Calle") numero = models.CharField(max_length=6, verbose_name="Numero") piso = models.IntegerField(verbose_name="Pi...