Hi Sharoon,
very impressive! It is a good idea to hide the EAV into the framework
and finding an easy to use API.
Am Samstag, den 21.08.2010, 15:23 +0100 schrieb Sharoon Thomas:
> Models:
> ir.attribute - Where the attributes for a model are defined
Maybe 'parameter' better? But unsure. 'Attribute' is a very generic
name.
> ========
> model : fields.Many2one('ir.model')
> name : fields.Char
> type : fields.Selection(
> [
> text/selection/binary/numeric
Which field types are included at all?
> selections : fields.One2Many ir.attribute.selections (try using property
> fields)
> active: fields.Boolean
> help: fields.Text
What about other attributes like:
states: (readonly, required)
domain
select
But I'am unsure about this. Because with these changes we are going to
reveal the logical layer to the user side, which is at least fragile.
[...]
> ir.attribute.selections
> ==============
better name 'Options'?
> attribute : fields.Many2One ir.attribute
> name : fields.Char
order? to determine the order of appearance of the options.
[...]
> New Model Abstraction called ModelEAV will be defined where the EAV pattern
> needs to be used.
Here ist the best part. The analytic_account series would be much more
readable with an own API. Good!
> ===============================
> So for product.product to use EAV pattern:
> from trytond.model import ModelSQL, ModelView, ModelEAV
> class ProductProduct(ModelEAV, ModelSQL, ModelView):
> _name = 'product.product'
> regular fields
> ProductProduct()
> and update the view to use a new tag <attributes />
> which will expand into a one2many list view where the attributes are
> shown/edited.
KISS you ;-) This looks incredible simple to use. Starting with a
tabular view for presentation makes the first step of implementation
more easy. One2many editable seems the right widget. It would be good to
think about form view for attributes, too. Iirc Cedric mentioned
somewhere that it will be good to have view definitions for one2many. In
a later step we could combine both...
Don't forget an admin panel to create attributes and options.
Thanks for your contributions.
Regards Udo
--
Udo Spallek
------------------------------------
virtual things
Preisler & Spallek GbR
Munich - Aix-la-Chapelle
Windeckstr. 77
81375 Munich - Germany
Tel: +49 (89) 710 481 55
Fax: +49 (89) 710 481 56
[email protected]
http://www.virtual-things.biz
--
[email protected] mailing list