(All code is some kind of pseudocode, just for better reading I have
an Invoice model:

 class Invoice(models.Model):
        // many fields here
I need to attach some products (with price for unit, and quantity
fields) to this invoice, so I made additional table:

class InvoiceProduct(models.Model):
    product = models.ForeignKey
    quantity = models.IntegerField
    unit_price = models.DecimalField
    invoice = models.ForeignKey(Invoice)
So, this is almost first question — «Could it be done better way?»

My second problem is, that in django admin I have manage these models
by inlines: Screenshot But my customer wants otherwise. He wants one
button (Add product) then pop-up windows appears, with fields:
product, quantity, unit price. He fills them, press OK. Then pop-up
window closes and line with "product fields" appears in main form. I
suppose I need override admin form template? Or I need to write my own
widget or smth like that?

Sorry for my English.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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