Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread DL Neil
On 23/06/19 7:56 PM, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = C

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread MRAB
On 2019-06-23 10:44, Arup Rakshit wrote: On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn)

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Arup Rakshit
> On 23-Jun-2019, at 2:31 PM, Cameron Simpson wrote: > > On 23Jun2019 13:26, Arup Rakshit wrote: >> In the below code: >> >> @classmethod >> def find(self, id): >> if isinstance(id, list): >> rows = self.__table__().get_all(*id).run(self.__db__().conn) >> result =

Re: Python refactoring question and create dynamic attributes

2019-06-23 Thread Cameron Simpson
On 23Jun2019 13:26, Arup Rakshit wrote: In the below code: @classmethod def find(self, id): if isinstance(id, list): rows = self.__table__().get_all(*id).run(self.__db__().conn) result = [] for row in rows: acategory = Category()