Giter VIP home page Giter VIP logo

Comments (5)

vprsnc avatar vprsnc commented on July 16, 2024

IndexError Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/core/formatters.py:707, in PlainTextFormatter.call(self, obj)
700 stream = StringIO()
701 printer = pretty.RepresentationPrinter(stream, self.verbose,
702 self.max_width, self.newline,
703 max_seq_length=self.max_seq_length,
704 singleton_pprinters=self.singleton_printers,
705 type_pprinters=self.type_printers,
706 deferred_pprinters=self.deferred_printers)
--> 707 printer.pretty(obj)
708 printer.flush()
709 return stream.getvalue()

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/lib/pretty.py:410, in RepresentationPrinter.pretty(self, obj)
407 return meth(obj, self, cycle)
408 if cls is not object
409 and callable(cls.dict.get('repr')):
--> 410 return _repr_pprint(obj, self, cycle)
412 return _default_pprint(obj, self, cycle)
413 finally:

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/lib/pretty.py:778, in repr_pprint(obj, p, cycle)
776 """A pprint that just redirects to the normal repr function."""
777 # Find newlines and replace them with p.break
()
--> 778 output = repr(obj)
779 lines = output.splitlines()
780 with p.group():

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/amocrm/v2/model.py:40, in Model.repr(self)
39 def repr(self):
---> 40 fields = [
41 "{} = {}".format(field.name, getattr(self, attr))
42 for attr, field in inspect.getmembers(self.class)
43 if isinstance(field, _FIELDS_FOR_REPR)
44 ]
45 return "{self.class.name}({fields})".format(self=self, fields=", ".join(fields))

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/amocrm/v2/model.py:41, in (.0)
39 def repr(self):
40 fields = [
---> 41 "{} = {}".format(field.name, getattr(self, attr))
42 for attr, field in inspect.getmembers(self.class)
43 if isinstance(field, _FIELDS_FOR_REPR)
44 ]
45 return "{self.class.name}({fields})".format(self=self, fields=", ".join(fields))

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/amocrm/v2/fields.py:33, in _BaseField.get(self, instance, _)
31 if data is None and not self._blank:
32 raise exceptions.NoDataException(str(self))
---> 33 return self.on_get_instance(instance, data)

File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/amocrm/v2/entity/events.py:93, in _EventValueField.on_get_instance(self, instance, value)
91 return value[0]["transaction"]["id"]
92 if instance.type in EVENT_TYPES_WITH_NOTE:
---> 93 return value[0]["note"]["id"]
94 if instance.type == EVENT_TYPE_NPS_RATE_ADDED:
95 return value[0]["nps"]["rate"]

IndexError: list index out of range

from amocrm_api.

vprsnc avatar vprsnc commented on July 16, 2024

При этом то же самое возникает, если забирать более ранние события:
events = Event.objects.filter(filters=[filters.DateRangeFilter("created_at")(now-timedelta(days=2), now-timedelta(days=1))])

Однако одиночное событие по object_id я забрать могу, все рабоает

from amocrm_api.

Krukov avatar Krukov commented on July 16, 2024

Прости, мало времени что бы посмотреть по подробнее, но вообще если раньше работало а теперь нет то амосрм могли изменить чуть свою апи - так уже было. Но может и бага на стороне библиотеки - попробую попозже.

from amocrm_api.

vprsnc avatar vprsnc commented on July 16, 2024

В общем, если фильтровать по какому-то определённому типу, то все нормально работает

Вернее работало, создал новую issue

from amocrm_api.

Krukov avatar Krukov commented on July 16, 2024

https://pypi.org/project/amocrm-api/2.5.0/

from amocrm_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.