Community: Framework mailing list archives
Re: New API: field names for Many2one and Many2many - shall we postifix with _id?by
- for a many2one, I automatically create an alias that happens an _id suffix no matter what. That means I can have product.categ_id that already exists. But product.categ_id_id is also a valid key that will return product.categ_id.id under the hood.
- for many2many, I create an alias with _ids. So I can have sale_order.order_line_ids that will in fact return the equivalent of [line.id for line in sale_order.order_line] (but done on the Ruby client side).
Hi guys!In old api we had to begin any operation with search method which returned ids of records.So we named the fields accordingly: user_id, user_ids.But new api does return recordset, so is there any reason to postfix with _id(s)?Now self.search([('search', '=', 'critaria')]) return not list with ids but objects!So using _id(s) can be misleading.New api now is like Django and they do not use _id(s).What do You thing?Regards,Max.
Post to: mailto:email@example.com