Open dmk23 opened 12 years ago
A little follow up on point 3 above. I've found that attribute could be initialized with "name" kwarg that is supposed to provide this functionality according to the comment in attributes.py. I tried the following model code -
created = models.DateTimeField(name='C')
After initializing the object using 'created' kwarg and trying .save() it failed with a validation error. As I looked through the code It became clear that the current implementation makes no distinction between model attribute names and Redis hash names. The 'name' kwarg simply replaces them both instead of only replacing the latter.
Seems like fixing this would require a significant rewrite everywhere the attribute name is used.
Hi there, I got to look a bit at how the whole Meta behaved. There was indeed some lack in the Documentation and in the db
attribute.
As for the option name
for attributes, I suggest to write a dedicated bug for that.
cheers,
A few comments -
1) Not clear what is the full list of supported meta options. I've seen "key", "indices" and "db". This should be documented 2) "db" meta option does not work. I was able to use different databases by directly overriding db property methods of my model classes, but clearly it is just a hack 3) "key" property that allows renaming Redis key bases is great but it would be helpful to also be able to rename specific attribute fields. It is a waste to force long descriptive names to be repeated over and over in Redis hashes. Best to support renaming them into short aliases