Hello, django-users.

I'm in need of some serious help on deciding how to design my next project.
Below is my attempt to describe the use case:

*USE CASE*
I'm writing an accounting app that will be generating unique monthly reports
of the revenue results for a list of Accounts (model) in the company.

Each Account has a set of instances of Entry (model) with a Decimal value,
date and some text, as well as a FK to Account.

These entries are uploaded through an (already coded) import function which
parses a .csv and, using DSE, inserts 1.5 million rows to the Entry table.
These entries also have an FK to Task (model) so I know which import process
generated them.

Each month I want to allow an admin to pick a set of Accounts to be
displayed in the monthly report, which needs to be unique for obvious
reasons.

*CODE
models.py
*http://dpaste.com/hold/570933/

*example .csv file to be imported* (importing the file is already coded and
works 100% so far)*
*http://dpaste.com/hold/570934/*
*
*QUESTIONS*
1. Should I create another model named MonthlyReport with an M2M relation to
Accounts, and then add an 'is_active' flag so I know which one is the
official monthly report?

2. If so, how can I ensure there's only one official monthly report? Perhaps
setting is_active to False to all the other MonthlyReports that carry the
same month/year?

3. How should I prevent users from importing the Entries more than once?
Forcing a deletion of entries for the same month as the imported entries is
a possible solution.. The .csv file should always be restricted to a single
month, but I guess I could write a check for that too, or expand the
deletion for every matching month.



As you can see, I have a few ideas on how to proceed, but it would be great
if anybody could weigh in on this, as the deadline is incredibly short (1
month including views/templates, etc).

I thank everyone in advance for reading through this and for any help they
can offer.

Cheers,
André

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