Hi Django-users list

I'm trying to make a simple application for modeling the order-taking process 
for a restaurant. This is not real but it's supposed to model reality.

So I have, basically, a list of products that people (end users) can buy, and I 
have an Order table (model) which relates one-to-many with a list of dishes 
and/or beverages.

An Order can be either open or closed, when an order is open this means we can 
add more dishes (or beverages) to the order. If the order is set to the 
"closed" state then the end user is supposed to have paid for the meal and left 
the restaurant ;)

What I need to do is generate some kind of form that will allow the end user to
1) Open a new order
2) given the menu listing (the list of products, dishes, beverages, etc that is 
available for consumption), click on a checkbox right next to the dish or 
beverage, and make that dish become an itme in the order created in point 1.

I'm having trouble figuring out how to do points 1 and 2 in one simple step or 
make the user feel it's all on the same screen. I was thinking of checkboxes to 
select which dishes should be part of the order, but it would be great to have 
a place in the left of the screen showing the available dishes and let the user 
drag-and-drop any dish on the left side to the right side, making it part of 
the order. 

Unfortunately I have no clue about how to do that, but would very much like to 
be able to code such a thing. In the end, all that I care is that the 
application itself is as usable as possible for a regular user who only cares 
about choosing what to eat.

These are the model definitions I have

class Order(models.Model):
    table = models.IntegerField()
    order_date = models.DateTimeField('date published')
    order_closed = models.BooleanField()
    
    def __unicode__(self):
        return u'%s' % self.id 
    class Admin:
        list_display = ('table', 'order_date', 'order_closed')

class OrderItem(models.Model):
    order_nbr = models.ForeignKey(Order, edit_inline=models.TABULAR, 
num_in_admin=4, core=True)
    item_id = models.ForeignKey(Dish, edit_inline=models.TABULAR, 
num_in_admin=4, core=True)
    quantity = models.IntegerField()
    def __unicode__(self):
        return u'%s - %s' % (self.order_nbr, self.item_id)
    class Admin:
        #pass
        list_display = ('order_nbr','item_id')


class Dish(models.Model):
    description = models.CharField(max_length=200, core=True)
    recipee = models.TextField(blank=True)
    price = models.DecimalField(max_digits=6, decimal_places=2, core=True)
    special_discount = models.DecimalField(max_digits=6, decimal_places=2)
    pub_date = models.DateTimeField('date published')
    foto = models.CharField(max_length=200, blank=True)
    def __unicode__(self):
        return self.description
    class Admin:
        list_display = ('description', 'recipee', 'price', 'special_discount')
        #pass



Thanks in advance for your time!
Cheers,
Mario



      
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to