GithubHelp home page GithubHelp logo

__qualname__ about eventsourcing HOT 4 CLOSED

pyeventsourcing avatar pyeventsourcing commented on May 18, 2024
__qualname__

from eventsourcing.

Comments (4)

johnbywater avatar johnbywater commented on May 18, 2024

Hey I'm really sorry for the delay, I only saw this issue was open yesterday.

I just pushed 7f9dd66; some changes (to the develop branch) that allow custom JSON encoder/decoder to be passed as application constructor parameters. Does that help?

I'm really interested to hear about how you are using it with Django. Do you think it would make sense to make something that works like a normal Django model? I'm just about to start a Django project to make a user interface for an event sourcing application, and would be really interested to hear your thoughts.

from eventsourcing.

johnbywater avatar johnbywater commented on May 18, 2024

Also FYI to get a __qualname__ attribute on a class you can use QualnameABCMeta as the meta class. For example, see the DomainEvent class. Both are in model/events.py.

The __qualname__ is needed primarily because the domain event classes are nested in the domain entity classes, and the event topic needs to have both so that the domain event topic can be resolved to a domain event class when a domain event is reconstituted from a stored event. If other object instances are set on the domain event, they are also expected by the default JSON encoder/decoder to have a __qualname__ attribute in case they happen to be nested. In Python 2, there is no way to tell when (where) a class is nested, unless you fix up something like QualnameABCMeta. As I'm sure you know, object classes in Python 3 already have a __qualname__ attribute.

from eventsourcing.

jellevandehaterd avatar jellevandehaterd commented on May 18, 2024

Hey Now the delay is on my side ;-) Just got back from my holiday.
Thnx for the update!. Updating to the development branch now.

I’m currently developing an app with Django (v1.8.x) and Django-oscar and it would be very useful to use event sourcing for some parts op the app. Currently I am focussing on subscriptions.
For the database I’m using Postgres v9.4 (Because of the JSONB field ;-) The 'DjangoStoredEvent’ model uses the JsonBfield http://djangonauts.github.io/django-pgjson/ (or the native JSONfield https://docs.djangoproject.com/en/1.9/ref/contrib/postgres/fields/#jsonfield for Django v1.9+ ) for ‘event_attrs’ so its effectively an documentstore with indexing capabilities and loads of other nice features. The django models stored in Json break the ObjectJsonEnecoder because of the missing qualname (Using python 2.7.x) so with this update I hopefully can try fix this. I tried adding the QualnameABCMeta as metaclass which resulted in al kinds of multimetaclass hell ;-)

Keep up the good work!

Op 27 dec. 2015, om 23:57 heeft John Bywater [email protected] het volgende geschreven:

Hey I'm really sorry for the delay, I only saw this issue was open yesterday.

I just pushed 7f9dd66 7f9dd66;
some changes (to the develop branch) that allow custom JSON encoder/decoder to be passed as application constructor parameters. Does that help?

I'm really interested to hear about how you are using it with Django. Do you think it would make sense to make something that works like a normal Django model? I'm just about to start a Django project to make a user interface for an event sourcing application, and would be really interested to hear your thoughts.


Reply to this email directly or view it on GitHub #3 (comment).

from eventsourcing.

johnbywater avatar johnbywater commented on May 18, 2024

Thanks! I got distracted. I'd love to chat with you about making a django-eventsourcing package. I just setup a mailing list for this project, it would be great if you were to join ;-). Hoping to discuss these things further with you soon...
https://groups.google.com/forum/#!forum/eventsourcing-users

from eventsourcing.

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.