I am designing an ISP control panel with django. I split the project in many
apps, some will be reusable, others not.
Well, one of its features is to provide mechanisms for users to create email
accounts on a mail server with a cost.
The apps involved on this process are:
mails: store the mail accounts information: mailname, domain, maildir, disk
quota... Designed to be a reusable app.
daemons: create the mail account on our mail server. Reusable app
contacts: store customer information and a relation with their contracted
mails. Reusable app
pricing: provide a price for the new mail. No reusable: depends on contacts
and billing.
billing: store mail orders with their price in order to future invoices. No
reusable: depends on contacts and pricing.
The process that I would have to follow in order to create a new mail is
just like this:
1. Select a 'customer' (App:contacts):
If you're an admin, you need to manually provide it
If you're an a user the 'customer' is retrieved using your session
2. Provide data for the new mail through a form.
3. if form is OK:
4. Show the price for this new mail (App:pricing)
5. if user is ok with the price:
6. Execute an asynchronous task:
6.1. Save the object to db. (App:mails)
6.2. Create the new mail account on the mail server
(App:daemons)
If Fail Rollback step 6.1
6.3. Create a 'contract' relating the new mail to their customer
(App:contacts)
If Fail Rollback steps 6.2, 6.1
6.4. Create an 'order' in order to create an invoice in the
future. (App:billing)
If Fail Rollback steps 6.3, 6.2, 6.1
6.5. Inform a user that their mail is now available.
7. Inform a user that their mail account petition is being processed
until step 6.5 ends.
My question is about the step 6. Considering that the step 6 implies
multiple apps, some of them should be reusable,
do you think that the sub-steps 6.1, 6.2, 6.3, 6.4 should be trigged
'automatically' in a model layer (using custom signals or overriding the
save model function)?
Or maybe the design should be better if theses steps are handled in a view
function with explicit calls to every step?
moreover every time that step 6.1 is executed, step 6.2 should be executed
(if daemons app is installed), as well as 6.3(if contacts are installed) and
6.4 steps (if billing).
What do you think ?
btw if you have any comment regarding anything else it will be really
appreciated, I'm pretty new on POO and MVC :)
Thanks!!
--
Marc
--
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.