table = Table.objects.filter(membertable__member=user, nominal=nominal)
                  
                  
                          if table:
                  
                  
                              return table
                  
                  
                          else:
                  
                  
                              user = user.parent
                  
                  
                              self.get_user_table(user, nominal)
                  
                  
                  
                  
                  
                  AttributeError: 'Table' object has no attribute 'get_user_table'
                  
                  
                  
                  
                  
                  как мне рекурсию сделать?
                  
                  
                
не пробовал mptt ?
tables = list() for nominal in nominals: user_tables = self.get_user_tables(user, nominal) if user_tables: tables.append(user_tables) else: return Response({'error': 'У {}'.format(nominal)}, status=400) странно выше рекурсия которая отдает норм то есть перед return принчу есть данные но тут не ловит в else уходит
Обсуждают сегодня