Ok. Take it easy with me because I think I understand your problem,
but the app goals seem amazing so I am going to try and help.

  First of all, I think you'll be asked to show both import and export
to the same users (which are carriers and forwarders now, right?). So
there's no sense in splitting them: Today, one delivers the goods and
another one brings it, but someday a company can do both things. So I
would merge Carrier and Forwarder, because they are really an "user",
they just need to see different types of Offers depending on their
interest. Let's call this model "Company" for now.

  An Offer is either an import or an export,  so I would go with 2)
Use one app "Offers" and put import/export models there, but with a
ForeignKey to an Offer.

  Something like:

class Offer(models.Model):
    products = models.ManyToManyField(Product)
    type = models.CharField(choices = (('import', 'Import'),
('export', 'Export'))
    seaport = models.ForeignKey(Seaport)
    target = models.ForeignKey(Y) # from your Seaport to Y example

class Import(models.Model):
    company = models.ForeignKey(Company)
    offer = models.OneToOneField(Offer)
    # additional fields like Price, Time, Completed, etc...

class Export(models.Model):
    company = models.ForeignKey(Company)
    offer = models.OneToOneField(Offer)
    # additional fields like Price, Time, Completed, etc...


  So here's what you're able to do (I hope I got it right):

  An user logs in. You pull the Offers based on the type field. He
selects one, and you record it (pseudo: Import.save(company =
request.user, offer = offer_selected)).

  In fact, Import and Export seems like they can be abstracted even
more (maybe, I don't know your requirements). You can make a class
named "Delivery" which has a ForeignKey to Company and Offer
(unique_together'ed), and a Transaction class, which has a
OneToOneField with Delivery but it stores the additional data.


On 8/1/06, Robert <[EMAIL PROTECTED]> wrote:
>
>
> I am designing a new truck transport database data service.
>
-- 
Julio Nobrega - http://www.inerciasensorial.com.br

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to