On 05 Sep 11:43, Korbinian Preisler wrote: > Hi, > > i noticed that it is not possible to use period_obj.find()[1] to get a > period of type 'adjustment'. But i think that this could be a missing > feature. > > I think the method should be able to handle these cases: > 1. Find periods of type 'standard' (current implementation) > 2. Find periods of type 'adjustment' > 3. Find periods of type 'standard' and 'adjustment' > > In the 3rd case the method should return a period of type 'standard' if > there is one found. If not it should return a period of type > 'adjustment' if there is one found. > > What do you think about?
I think it is wrong. 'adjustment' period aim to be used only for manual entries. Moreover, as there are no date overlaps constraint on 'adjustment' period, the result of a 'find' could be multiple. So we could change to return always a list by in that case, we have to bloat the API just for rare case. Or we could make it return different type depending of paramaters but experience shows that it generates a lot of bugs (remember the read with single id). Or we cuold make it return the first one, but in this case what is first? and it will be a kind of random API. So for me, the current is just fine. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
pgpLUHsBULYtV.pgp
Description: PGP signature