I'm working a special situation where I'm trying to emulate the django feel of model classes like so:
class packet(models.packet):
field1 = models.IntField()
field2 = models.IntField()
There's a lot of background interfacing using metaclassing but the over idea is to allow the user to interact with the fields like so:
p = packet()
p.field1 = 12
p.field1 == 12 # true
while still not compromising the field type:
isinstance(p.field1, models.IntField) # true
The problem that I'm facing is that two packet
objects share the same Fields
since they're class properties:
p1 = packet()
p2 = packet()
p1.field1 = 12
p2.field2 = 14
p1 is p2 # false
p1.field1 is p2.field1 # true
How do I instantiate a new property object for each new parent object?
To give better context feel free to browse the source here