import os


class BaseGenerator(object):
    """
    In order to create your own generator, please subclass this base class implementing "save" method
    """

    # displayed name
    name = 'Not implemented generator'

    # slug should be unique for each generator
    slug = 'not-implemented-generator'

    # field types for which it will be displayed
    for_fields = []

    # form for extra parameters, can be None
    options_form = None

    # method executed for obj instance
    def save(self, obj, field, form_data):
        raise NotImplemented

    # method executed for each model field in "for_fields" to check if this generator supports such field
    # can be overridden
    @classmethod
    def is_available(cls, field):
        return True

    # used to get full path for files relative to generator
    def rel_path(self, *path):
        return os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)

import os


class BaseGenerator(object):
    """
    In order to create your own generator, please subclass this base class implementing "save" method
    """

    # displayed name
    name = 'Not implemented generator'

    # slug should be unique for each generator
    slug = 'not-implemented-generator'

    # field types for which it will be displayed
    for_fields = []

    # form for extra parameters, can be None
    options_form = None

    # method executed for obj instance
    def save(self, obj, field, form_data):
        raise NotImplemented

    # method executed for each model field in "for_fields" to check if this generator supports such field
    # can be overridden
    @classmethod
    def is_available(cls, field):
        return True

    # used to get full path for files relative to generator
    def rel_path(self, *path):
        return os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)

In order to create your own generator, please subclass this base class implementing "save" method # displayed name # slug should be unique for each generator # field types for which it will be displayed # form for extra parameters, can be None # method executed for obj instance # method executed for each model field in "for_fields" to check if this generator supports such field # can be overridden # used to get full path for files relative to generator