Ok, sorry if this may seem like a long post to some. I have created a framework of sorts to generate tables for an accounting system.
They tables themselves are generate from various Python programs that read layouts from old COBOL programs/ AppGen 4gl / Informix schemas , Oracle schemas ,Tryton and Oodo and taking the best ideas from all. The procedures create a template file that I then use to generate the complete structure for the accounting system database. I need to get these layouts into web2py to start building my applications. It is for a Postgres based database only (on my end). The questions are (and based on the template file at the end): A: How easy to adapt my generator to auto create the necessary DAL entries into the database section of web2py B: I saw that I can use Postgres to store my DAL information rather that flat files and Iv'e lost my links to that - can this be automated as well? Thanks In advance - Ben Duncan Sample - Accounts Receivable Open Item File: # Generator Parameters: # : = End Type of field , '|' = Field seperators # # FILE = Table Name to generate # ENDFILE - End of Table Defination # DESC - Descriptive Information for Documentor ############################################################ # Lines that start with FORKEY are foreign key layouts # They are divided by '|': # Column 1 is name of the key ,Names to be created by FILE_<NAME>_fkey # column 2 is referenced (parent) table # Column 3 is names of fields in the layout that make up the fk layout # They are divided by ',': # Optional Column 4 is the Referential Action to be performed: # On DELETE, ON UPDATE, etc... # Program will generate key in the format of # <file>_<key name>_fkey ############################################################ # Lines that start with SECKEY are secondary keys. # Column 1 is the key name # Column 2 is the list of keys to form the secondary keyes # They are divided by ',': # Program will generate key in the format of # <file>_<key name>_idx ############################################################ # Lines that start with UNIKEY are unique secondary keys. # Column 1 is the key name # Column 2 is the list of keys to form the secondary keyes # They are divided by ',': # Program will generate key in the format of # <file>_<key name>_idx # # Program will generate key in the format of # <file>_<key name>_fkey # ############################################################ # Lines that start with FIELDS: are the field definitions. # First Field After the ':' is a Type (single Value or multi value - # not used at this time) # Second is the 'K' value that signifies this is part of the # primary key, if not K, it is ignored. # Third is 'N"' for producing 'NOT NULL' # Forth is the field name # Fifth is the Descriptive narrative for the field used by # documentor # Sixth is the TYPE # Seventh is the length (ignored for default types) # Eight is for any additional constraints - "DEFAULT 0" ...etc # ############################################################ FILE:AR_OPEN DESC:Ar Open Items DESC: This is the OPEN items file. DESC: For MEC use the REFERENCE to refer to CASE details. DESC: DOC_TYPE - I = Invoice, P = Payment, N = Interest, F = Add on Fee DESC: C = Credit mem0, D = Debit Memo FORKEY: COMPANY|COMPANY|COMPANY_NUMBER|ON DELETE CASCADE FORKEY: CLIENT|CLIENT|COMPANY_NUMBER,CLIENT_NUMBER|ON DELETE CASCADE SECKEY: AR_OPEN_DOC|COMPANY_NUMBER,DOC_NO FIELDS:S|K|N|COMPANY_NUMBER|Company ID|N6,06|999999| FIELDS:S|K|N|CLIENT_NUMBER|Customer Code|N12,012|12| FIELDS:S|K|N|DOC_NO|Document Number|N10,012|99999999999| FIELDS:S|0|N|POSTED_TIMESTAMP|Posted Time Stamp|T|12| FIELDS:S|0|N|DOC_TYPE|Doc Type - I = Invoice, P = Payment, I = Interest, F = Add on Fee|A|1| FIELDS:S|0|N|DOC_DATE|Original Doc Date|D|8| FIELDS:S|0|0|ORIG_DOC|Original Document|N10,012|999999999| FIELDS:S|0|0|HOLD_TO_DATE|Date to start AGEING |D|8| FIELDS:S|0|0|ORIGINAL_AMOUNT|ORIGINAL AMOUNT|MONEY|999999999| FIELDS:S|0|0|BAL_DUE|Document Balance|MONEY|999999999|DEFAULT 0 FIELDS:S|0|0|PAID_AMOUNT|Paid on Item|MONEY|999999999|DEFAULT 0 FIELDS:S|0|0|DISC_AMT|Applied Discount|MONEY|999999999|DEFAULT 0 FIELDS:S|0|0|REFERENCE|Reference/Case ID|V|255| FIELDS:S|0|0|APPLIED_DATE|Date Applied|D|8| FIELDS:S|5|0|APPLIED_DOC|Applied Doc_NUM|N10,012|99999999999| FIELDS:S|0|0|APPLIED_REF|Applied Reference|V|25| ENDFILE: -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.