0

I am trying to write an alternative way of creating models, other from the one Django uses (metaclasses that is).

Currently, Django uses a metaclass to put all field declarations from a user-declared model in a fields dictionary and then uses this dictionary to assign user-declared model attributes from the given kwarg list provided when instantiating this model.

What other methods of doing this are available? I thought about using decorators, but then I cannot subclass the base Model class (upon which the decorator acts) to create user-declared models. Thank you for pointing me in any direction!

linkyndy
  • 17,038
  • 20
  • 114
  • 194
  • Your second paragraph is a fantastic summary of what Django currently does, but the rest of your question is perplexing. Why do you want to do this? What is the expected end result? Is it just to see if you can, or are you hoping to achieve something specific? – Daniel Roseman Sep 25 '13 at 09:49
  • I am required to do something similar to what Django does. And I have no clue of how can I do this by other means. – linkyndy Sep 25 '13 at 09:52

0 Answers0