django

search functionality on multi-language django site

hi folks, I'm building a multi-language Django site, and I'm using django-transmeta for my model data translations. Now I'm wondering if there is a Django search app that works with multi-language models. I've played with Haystack and it works fine for single-language sites, but I can't get it to work with transmeta's metaclasses... Do...

What are some useful non-built-in Django tags?

I'm relatively new to Django and I'm trying to build up my toolbox for future projects. In my last project, when a built-in template tag didn't do quite what I needed, I would make a mangled mess of the template to shoe-horn in the feature. I later would find a template tag that would have saved me time and ugly code. So what are some...

Redirecting in Admin Site

I have an app called CMS with Category and Article. Quite simple. I overwrite app_index.html to enable ajax-based drag-n-drop ordering and to move articles from one category to another. Now I would like to redirect after saving/deleting an article or a category to cms' app_index.html instead of the model's change_list.html. How can thi...

Django javascript files

In a Django app, where should I put my javascript/jquery scripts? ...

Can a WIN32 program authenticate into Django authentication system, using MYSQL?

I have a web service with Django Framework. My friend's project is a WIN32 program and also a MS-sql server. The Win32 program currently has a login system that talks to a MS-sql for authentication. However, we would like to INTEGRATE this login system as one. Please answer the 2 things: I want scrap the MS-SQL to use only the Djang...

Testing Django Models with FileField

I'm trying to make the transition to testing with Django. This is the particular model in question for testing: class Media(models.Model): file = models.FileField(upload_to='upload',) thumbnail = models.ImageField(upload_to='upload', blank=True,) # ... PART 1: How do I deal with these FileFields? (Particularly in the se...

Efficient Django QuerySet regex

I have a model like this: class CampaignPermittedURL(models.Model): hostname = models.CharField(max_length=255) path = models.CharField(max_length=255,blank=True) On a frequent basis, I will be handed a URL, which I can urlsplit into a hostname and a path. What I'd like is for the end user to be able to enter a hostname (yaho...

Django scheduled jobs

I'm writing some auction functionality for a website powered by Django, and there is an option to have the auction be extended by a few seconds every time somebody bids (so that there is no last-minute sniping). When the auction is finished, certain things need to be done like notifying the winner of their victory and notifying the selle...

How do I override delete() on a model and have it still work with related deletes

class Widget(models.Model): title = models.CharField(max_length=255) class WidgetFile(models.Model): widget = models.ForeignKey(Widget) def delete(): # do some custom hard drive file vodo super(WidgetFile, self).delete() ... some code to create a Widget and a WidgetFile to go with it ... some_widget_instan...

The Installer could not find Models of cms app in Django-CMS

I have installed django-cms in my hosting. But there is a problem. That's when I make syncdb, all my apps are synced, cms app is not. Although I have declared full enough in the settings. It is also not error at all. Someone help me. Thanks a lot! (1146, "Table '***.cms_page' doesn't exist") ...

Customizing time zones for Django users using geography

I am working on a Django app that needs to report the local time relative to the user. I would prefer not ask the user to input the time zone directly because I have his address stored in the database. I am only considering American users. Since most states in the USA are in only one time zone it is possible to calculate the time zone...

How to do email-confirmation after registration in Django?

I am using Django's authentication system. Is there an easy way to do this? ...

Wrapper google.appengine.ext.db.Model => django.db.models.Model

Given that gae & django persistence layers are quite similar, I'm wondering whether someone has tried creating a wrapper? Say, could be useful for utilizing django.forms.ModelForm. Are there any fundamental problems with this? ...

Creating Title / Slug based on PK ID

What would be the generic way to create record title and slub based on the ID? I am working with django-photologue here. I want to save a record with title and slug based on the PK. The generic problem is that I can't get the PK until the record is saved into database. On the other side, I can't save it without title and slug. What com...

Perform an action and redirecting to the same URL doesn't refresh the page

We are working on a new web site using Apache, Python and Django. In the development phase, no problem but once binding to Apache, using Firefox 3.5.3, we got a strange problem. We stand on : http://website.fr/search/ When we want to change the ordering of the research, we are sending the user to : http://website.fr/search/order/pri...

Django Reuseable Apps

I came across many resources about the difference between Django projects and reusable apps, most prominently the DjangoCon talk, and Pinax Project. However, being a newbie, writing my own projects and reusable software seems to a bit challenging. I don't quite understand how where models go (and how apps can be flexible and permissive...

Can I filter on request.user when using Django generic views?

I want to do something like this (from my urls.py), but I don't know if it's possible to get the user making the request: url(r'^jobs/(page(?P<page>[0-9]+)/)?$', object_list, {'queryset': Job.objects.filter(user=request.user), 'template_name': 'shootmpi/molecule_list.html'}, name='user_jobs'), ...

Furthest distance between any two points with GeoDjango

I have a collection of Point objects. I want to find the furthest distance between any two points. Imagine a circle enclosing all of these points. I want to know the diameter of that circle. How can I do this in GeoDjango? edit: this is what I have so far: >>> r=Route.objects.get(pk=1) >>> a=Airport.objects.filter(routebase__route=r) ...

Does it matter where the Django project exists on the system?

Aside from not deploying a Django project to the web site root directory, is there any specific benefit to running Django projects from one location, e.g. /var/django-projects/*xxxxx-project/ vs. (in a shared hosting environment) running each Django project in a domain folder, e.g. */vhost/mydomain.com/xxxxx-project? ...

Difference between GET and FILTER in Django model layer.

What is the difference, please explain them in laymen's terms with examples. Thanks! ...