Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events hook issue since last update #1446

Open
skidrow88 opened this issue Mar 5, 2021 · 5 comments
Open

Events hook issue since last update #1446

skidrow88 opened this issue Mar 5, 2021 · 5 comments

Comments

@skidrow88
Copy link

Expected Behavior

Since I have updated the Eve version to the latest, I have the following error at start up with events hook declaration:

AttributeError: type object 'Eve' has no attribute '__event_slot_cls__'
from eve import Eve
from pymongo import MongoClient
from flask import current_app as app
from flask import send_from_directory, abort, request
from redis import Redis
import asyncio
import time
import json
from eve.auth import TokenAuth, requires_auth
import os
import re
import datetime 

file_dir = os.path.dirname(os.path.realpath(__file__))
static_folder = os.path.join(file_dir, 'static')
ALLOWED_EXTENSIONS = {'jpg', 'jpeg'}
 
def pre_get_callback(resource, request, lookup):
  print('A GET request on the "%s" endpoint has just been received!' % resource)
  

app = Eve(redis=Redis(), auth=AppAuth, static_folder=static_folder)
app.on_pre_GET += pre_get_callback

if __name__ == '__main__':
  app.run()

Actual Behavior

There is the full error

   File "/home/webapp/bolid/bolid/eve/run.py", line 96, in <module>
    app.on_pre_GET += pre_get_callback
  File "/home/webapp/bolid/bolidenv/lib/python3.7/site-packages/events/events.py", line 99, in __getattr__
    self.__dict__[name] = ev = self.__event_slot_cls__(name)
  File "/home/webapp/bolid/bolidenv/lib/python3.7/site-packages/events/events.py", line 89, in __getattr__
    (self.__class__.__name__, name))
AttributeError: type object 'Eve' has no attribute '__event_slot_cls__'

Environment

  • Python version: python3.7
  • Eve version:
  • Eve version: 1.1.5
  • Events: 0.4
@skidrow88
Copy link
Author

Any update about this issue ?

@bronte2k7
Copy link

Hi @skidrow88

Downgrade your package events need 0.3

@skidrow88
Copy link
Author

Yes @bronte2k7 I've done this solution until the issue is resolved

@stale
Copy link

stale bot commented Apr 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Apr 16, 2022
@skidrow88
Copy link
Author

Yes it is.

@stale stale bot removed the stale label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants