Django django-smart-select: get TemplateSyntaxError during adding of data in admin site

I'm a Django newbie. I want to try this app django-smart-selects. I would like the "Customer" adress being auto-populated by choosing the appropiate "Customer" in the "Order" form of the admin site.

So I have defined the following

from smart_selects.db_fields import ChainedForeignKey 
from django.db import models

# Adress model
class Adresse (models.Model):
    strasse = models.CharField(max_length=50)
    plz = models.IntegerField(max_length=5)
    ort = models.CharField(max_length=50)

    def __unicode__(self):
        return self.strasse

# Customer model
class Customer (models.Model):
    name = models.CharField(max_length=50)
    adresse = models.ForeignKey(Adresse)

    def __unicode__(self):

# Order model 
class Order (models.Model):
    name = models.CharField(max_length=50)
    delivery_time = models.DateTimeField()
    created_at = models.DateTimeField(auto_now_add=True)
    kunde = models.ForeignKey(Customer, related_name="Kunde")
    adresse = ChainedForeignKey(

    class Meta:
        db_table = 'order'
        ordering = ['-created_at']

    def __unicode__(self):

from django.contrib import admin
from customer_order.test_app.models import Adresse, Customer, Order

class AdresseAdmin(admin.ModelAdmin):
    list_display = ('strasse', 'plz', 'ort',)

class CustomerAdmin(admin.ModelAdmin):
    list_display = ('name', 'adresse',)
    list_per_page = 50

class OrdersAdmin(admin.ModelAdmin):
    list_display = ('name', 'delivery_time', 'created_at', 'kunde', 'adresse',)
    list_display_links = ('name',)
    list_per_page = 50
    ordering = ['-created_at'], AdresseAdmin), CustomerAdmin), OrdersAdmin)

Now when I want to add the first entries into the "Order" table through the admin add-Button, I got the following error:

Request Method:   GET
Request URL:
Exception Type:  TemplateSyntaxError
Exception Value:  

Caught an exception while rendering: Reverse for 'chained_filter' with arguments '()' and keyword arguments '{'field': 'strasse', 'app': 'test_app', 'model': 'Customer', 'value': '1'}' not found.

Original Traceback (most recent call last):
  File "C:\Python25\lib\site-packages\django\template\", line 71, in render_node
    result = node.render(context)
  File "C:\Python25\lib\site-packages\django\template\", line 87, in render
    output = force_unicode(self.filter_expression.resolve(context))
  File "C:\Python25\lib\site-packages\django\utils\", line 71, in force_unicode
    s = unicode(s)
  File "C:\Python25\lib\site-packages\django\forms\", line 356, in __unicode__
    return self.as_widget()
  File "C:\Python25\lib\site-packages\django\forms\", line 391, in as_widget
    return widget.render(name, data, attrs=attrs)
  File "C:\Python25\lib\site-packages\django\contrib\admin\", line 231, in render
    output = [self.widget.render(name, value, *args, **kwargs)]
  File "H:\customer_order\smart_selects\", line 36, in render
    url = "/".join(reverse("chained_filter", kwargs={'app':self.app_name,'model':self.model_name,'field':self.model_field,'value':"1"}).split("/")[:-2])
  File "C:\Python25\lib\site-packages\django\core\", line 350, in reverse
    *args, **kwargs)))
  File "C:\Python25\lib\site-packages\django\core\", line 300, in reverse
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'chained_filter' with arguments '()' and keyword arguments '{'field': 'strasse', 'app': 'test_app', 'model': 'Customer', 'value': '1'}' not found.

Exception Location:  C:\Python25\lib\site-packages\django\template\ in render_node, line 81
Python Executable:  C:\Python25\python.exe
Python Version:  2.5.0


Have you done step 2 from the installation instructions - adding the following into your

url(r'^chaining/', include('smart_selects.urls')),

Need Your Help

Independent margin for list items

html css html-lists

As you can see in this fiddle: I set the margin-top of 1 list item to be 50px, but all of them follow this style.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.