Re: Model with Dynamic Data Fields

2009-05-24 Thread oliver.pra...@googlemail.com
@DanielMedia Why not just ad the field document_number [INT] to documents (with maybe NUL as possible value). Its just one more field, and your setup would require a join etc. (a lot more db querying than needed) With the fact being a Document only can have 1 number ... which would sound sane to

Re: Model with Dynamic Data Fields

2009-05-23 Thread DanielMedia
How about creating a multiple table setup? This would let you have many attachments, etc per document. Then all you would have to do is check the sub-tables for any data relating to the document's ID. documents -- id title body created modified document_attachments --

Re: Model with Dynamic Data Fields

2009-05-23 Thread brian
I would create a table, documents, that has the fields that all your file types require (eg. id, filename) and one each for your doc types (eg. text_docs, pdf_docs, etc.) and use something like InheritableBehavior [1]. You could also use ExtendableBehavior [2] and save everything to a single tabl

Re: Model with Dynamic Data Fields

2009-05-23 Thread number9
I'm by no means an expert so somebody may want to disagree here, but I think if you are not bothering with templates, I would have one "documents" table, with all of the possible relevant fields. You could possibly break it up if you wanted to, and break up the information in seperate tables and l

Re: Model with Dynamic Data Fields

2009-05-23 Thread byqsri
Ok many thanks that's is clear I have another question Do I keep the values of the fields of all documents in a single table? a table like this: document_id, document_field_id, value I ask this question Because in 'value' I can have a number ,a string, a text ,a datetime I don't know if it's th

Re: Model with Dynamic Data Fields

2009-05-23 Thread number9
If I've understood you correctly each document will have a number of different fields that would be useful to store in the database, but all documents are unique. The first thing I would do is write down a list of every single possible field that you would need for these documents. If you thi

Model with Dynamic Data Fields

2009-05-23 Thread marco.rizze...@gmail.com
Hi My problem is about the project of the models of my web application I have a model Document . The problem is that this model must have dinamic data fields. A document can have like fields : title .text , data Another can have : title, number , attachment ect... This fields can have different ty