Schema mode summary

64 views
Skip to first unread message

nemesis

unread,
Jul 21, 2014, 11:33:49 AM7/21/14
to django...@googlegroups.com
Here's the pull request:

Here's a summary:
  • i've been able to implement the schema mode for django >= 1.6 only
  • the schema mode creates virtual fields which recycle the standard django fields, no duplication of code, validation is defined in the standard django fields
  • it is possible to pass other fields to the schema attribute, the only requisite is that the field is some kind of subclass of django.db.models.Field
  • initially i saved the pickled values in the DB, but then I realized it was a bad idea, now i'm using the to_python method of the corresponding virtual fields
  • when using the schema mode it is necessary to use django_hstore.hstore.SchemaModel as a base class for models and django_hstore.admin.HStoreSchemaAdmin as a base class to add support in the admin. I could not find any clean workaround this limit.
Future possibilities:
  • custom lookups like SchemaDataBag.objects.filter(number__lte=5) being number an hstore key
  • django admin filters for hstore keys
Please review the code, test it and send feedback.

Federico

Nemesis

unread,
Jul 22, 2014, 4:44:20 AM7/22/14
to django...@googlegroups.com
I encourage everyone who has not yet given feedback to do so.

I would like to merge this feature and release it soon so we can start getting real world feedback in order to improve it.

I think this feature is very useful and very handy, it might be perfected and reused elsewhere (the future binary json field for example).

The sooner we release it, the sooner we start to improve it, the better - but I also do not want to do things in a hurry, that's why I would like some more feedback before merging.

So you would be very helpful if you could download the features/schema branch and try to run your application with that version to see if you get any issue or failing test.

Federico
--
You received this message because you are subscribed to the Google Groups "django-hstore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-hstor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages