This group has been so helpful, and I'm so close to finishing my first
Django app for my client. I've run into one unusual sticking point...

I'm trying to create a model in which a customer can enter information
as an Order model via a form. Also, sometimes, the Admin interface will
be used to enter an Order. It's for a title search company who wanted
to put their order process online.

The Order model is fairly straightforward:

class Order(models.Model):
    date = models.DateField()
    customer = models.ForeignKey(Customer)
    service = models.CharField(maxlength=100)
    fee = ...

    ##borrowers = models.ManyToManyField(Borrower)

    property_address1 = ...
    property_address2 = ...
    property_city = ...
    property_state = ...
    property_zip = ...
    property_county = ...

    ...

The ManyToManyField is the sticking point. Originally, I tried this for
the model for the Borrower. Note the use of an edit_inline foreign key,
which I commented out to try a ManyToManyField to see how the usability
worked. That didn't work out because I don't want to see every borrower
ever entered into the application!

class Borrower(models.Model):
    #order = models.ForeignKey(Order, edit_inline=models.STACKED,
num_in_admin=4)
    borrower_first_name = ...
    borrower_last_name = ...
    borrower_ssn = ...

Here's the situation: When an admin (admin here meaning a person) uses
the Admin interface, the Borrower.order ForeignKey(edit_inline) works
just great. I can add as many Borrowers as could potentially be on a
mortgage. But then, how do I access the Borrower model from my
create_order view, when I have already created a manipulator for the
Order model?

I guess what I'm asking is, how can I recreate the situation from the
API example in the first tutorial, in which a Poll was given knowledge
of a Choice object using the create() method, but do so automatically,
both in the Admin interface and in the create_order view?

Please excuse me if I've missed some obvious aspect of database
programming. SQL and database programming are somewhat new areas of
exploration for me.

Thanks for any help you can lend! I promise that once I know enough,
I'll contribute back to the community!

- Dave Worley


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