New attributes API #117

Closed
opened 2017-04-02 23:18:04 +02:00 by nik · 9 comments
nik commented 2017-04-02 23:18:04 +02:00 (Migrated from edugit.org)

We want to move a more abstract API for setting attributes on game objects.

For setting an attribute: my_object.foo = bar
For getting an ttribute: my_obecjt.foo

Doing that, we also want to support storing arbitrary data types. It might be advisable to use the Pickle data type from SQLAlchemy as the attribute's value column instead of string.

The __setattr__ method must make sure to not handle attributes that are real databse columns - it must only handle attributes that are not used by the model itself! All others must be passed on to the superclass' __setattr__ method.

Same goes for __getattr__, which must return existing, real attributes verbatim.

Mind that there are a lot of corner cases for all of that!

We want to move a more abstract API for setting attributes on game objects. For setting an attribute: `my_object.foo = bar` For getting an ttribute: `my_obecjt.foo` Doing that, we also want to support storing arbitrary data types. It might be advisable to use the Pickle data type from SQLAlchemy as the attribute's value column instead of string. The `__setattr__` method must make sure to not handle attributes that are real databse columns - it must only handle attributes that are not used by the model itself! All others must be passed on to the superclass' `__setattr__` method. Same goes for `__getattr__`, which must return existing, real attributes verbatim. Mind that there are *a lot* of corner cases for all of that!
nik commented 2017-04-12 17:24:59 +02:00 (Migrated from edugit.org)

@Creeparoo please work in a new branch, branched from current master.

@Creeparoo please work in a new branch, branched from current `master`.
nik commented 2017-04-14 15:07:25 +02:00 (Migrated from edugit.org)

Started branch 117-new-attributes-api

Started branch [`117-new-attributes-api`](https://edugit.org/Veripeditus/veripeditus-server/compare/master...117-new-attributes-api)
nik commented 2017-04-14 15:47:44 +02:00 (Migrated from edugit.org)

Mentioned in commit ac6023acdf

Mentioned in commit ac6023acdf762b0c9b34c458d8d348e34918afd6
nik commented 2017-04-14 15:47:44 +02:00 (Migrated from edugit.org)

Mentioned in commit 7af3125bc0

Mentioned in commit 7af3125bc07fbb1c17a2c9f2bdb9e4a323a87847
nik commented 2017-04-14 18:01:06 +02:00 (Migrated from edugit.org)

Mentioned in commit 793fc1acb4

Mentioned in commit 793fc1acb41970b16dfa70da86fd4b874d3fe87c
nik commented 2017-04-14 18:01:06 +02:00 (Migrated from edugit.org)

Mentioned in commit 270e2a1140

Mentioned in commit 270e2a11409efe9011e4ab9954c6a379fae3d228
nik commented 2017-04-14 18:01:06 +02:00 (Migrated from edugit.org)

Mentioned in commit 29e7e88323

Mentioned in commit 29e7e88323c8f0f2b0c7239879aa051b6c28cd9e
nik commented 2017-04-14 18:01:06 +02:00 (Migrated from edugit.org)

Mentioned in commit d83abed90b

Mentioned in commit d83abed90bf6abcc9418475ef35d187f78e60fab
nik commented 2017-04-14 18:02:59 +02:00 (Migrated from edugit.org)

Status changed to closed by commit d83abed90b

Status changed to closed by commit d83abed90bf6abcc9418475ef35d187f78e60fab
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nik/veripeditus-server#117
No description provided.