Skip to content

Instantly share code, notes, and snippets.

View alfredcai's full-sized avatar
🚀

shAlfred alfredcai

🚀
  • Ethermars.com
  • Shanghai, China
View GitHub Profile
@alfredcai
alfredcai / resources.py
Last active April 3, 2018 22:48
set dataset quota by FreeNas API
class DatasetResource(DojoResource):
# ...other functions
def obj_create(self, bundle, **kwargs):
bundle = self.full_hydrate(bundle)
props = None
dataset_quota = bundle.data.get('quota')
if dataset_quota:
props = {
'casesensitivity':'sensitive',
'compression':'inherit',