Hi all of you!

I need to customize a bit the admin interface for one of my Django
projects.

In my models.py I have:

class ProductFirstLevel(models.Model):
    name = models.CharField(max_length=30)

class ProductSecondLevel(models.Model):
    name = models.CharField(max_length=30)
    belongs_to = models.ForeignKey(ProductFirstLevel)

class Product(models.Model):
    name = models.CharField(max_length=30)
    cost = models.DecimalField(max_digits=10, decimal_places=2)
[...]
    belongs_to = models.ForeignKey(ProductSecondLevel)

class Transaction(models.Model):
    product = models.ForeignKey(Product)
    amount = models.DecimalField(max_digits=10, decimal_places=2)
    date = models.DateField()

Since Product will be made of hundreds of items, I added a couple of
models (ProductFirstLevel and ProductSecondLevel) to provide Products
with a tree structure, some kind of a hierarchy.

When I add a new Transaction via my admin panel, I am asked to choose
for a Product from a drop down menu. Nothing weird... The point is,
that drop down list is definetely too long.

I wish I could customize my AddTransaction admin form so that the drop
down menu will run some js and will show some multi level features,
taking advantage of the tree structure itself.

Any tips to get this?

Thank you so much, Fabio.

-- 
Fabio Natali


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to