Sounds awesome.


On Tue, Apr 30, 2013 at 1:56 AM, Maxime Verger-Del Bove <
notifications@github.com> wrote:

> In gooddataclient/columns.py:
>
> > +        # useful in case we create a label that references a connection point
> > +        if label_references_cp:
> > +            self.references_cp = label_references_cp
> > +
> > +        maql = self.TEMPLATE_CREATE
> > +
> > +        # Altering data type if needed
> > +        if self.dataType and self.TEMPLATE_DATATYPE:
> > +            maql = maql + self.TEMPLATE_DATATYPE
> > +
> > +        # Adding the time in the case of a date
> > +        # with datetime set to True
> > +        if isinstance(self, Date) and self.datetime:
> > +            maql = maql + self.time.get_maql()
> > +
> > +        return maql % {
>
> Subclassing dict would have been great if done at the beginning. I would
> have to change a lots of thing I think. But I may have one solution, that
> both saves time and lines of code:
>
> def __getitem__(self, item):
>     return getattr(self, item)
>
> This allows to do something like 'my_string %(format)s' % self, and it
> even works with @property
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Work4Labs/gooddata-python/pull/5/files#r4014788>
> .
>