# Path: antioch/core/models.py
# class URLField(models.CharField):
# class Object(models.Model):
#     class Meta:
# class Relationship(models.Model):
#     class Meta:
# class Observation(models.Model):
#     class Meta:
# class Alias(models.Model):
#     class Meta:
# class Repository(models.Model):
#     class Meta:
# class Verb(models.Model):
#     class Meta:
# class VerbName(models.Model):
#     class Meta:
# class Property(models.Model):
#     class Meta:
# class Permission(models.Model):
#     class Meta:
# class Access(models.Model):
#     class Meta:
# class Player(models.Model):
#     class Meta:
# class Task(models.Model):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def annotated(self):
#     def name(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def actor(self):
#     def entity(self):
#     def origin(self):
#     def __str__(self):
#     def __str__(self):
#     def is_authenticated(self):
#     def is_active(self):
#     def is_staff(self):
#     def is_superuser(self):
#     def has_module_perms(self, app):
#     def has_perm(self, perm):
#     def email(self):
# 
# Path: antioch/plugins/editors/tasks.py
# def openeditor(user_id, object_id, type, name):
# def openaccess(user_id, object_id, type, name):
# def modifyobject(user_id, object, name, location, parents, owner):
# def modifyverb(user_id, object_id, verb_id, names, code, ability, method, owner):
# def removeverb(user_id, object_id, verb_name):
# def removeproperty(user_id, object_id, property_name):
# def modifyproperty(user_id, object_id, property_id, name, value, type, owner):
# def modifyaccess(user_id, object_id, type, access):
# def getobjectdetails(user_id, object_id):


from django import forms
from django.forms import widgets
from django.forms.models import BaseModelFormSet
from dal import autocomplete
from antioch.core import models
from antioch.plugins.editors import tasks
            user_id        = self.user_id,
            object        = self.instance.origin.id,
            property_id = self.instance.id,
            name        = self.cleaned_data['name'],
            value        = self.cleaned_data['value'],
            type        = self.cleaned_data['type'],
            owner        = self.cleaned_data['owner'],
        ).get(timeout=5)
        return self

class VerbForm(AuthenticatedModelForm):
    class Meta:
        model = models.Verb
        exclude = ('origin',)
        autocomplete_fields = ('owner',)
        widgets = {
            'owner': autocomplete.ModelSelect2(url='object-autocomplete'),
        }
    
    names = forms.CharField()
    code = forms.CharField(widget=widgets.HiddenInput)
    
    def clean_owner(self):
        value = self.cleaned_data['owner']
        return value.id if value else None
    
    def _post_clean(self):
        pass
    
    def save(self, force_insert=False, force_update=False, commit=True):

# Path: antioch/core/models.py
# class URLField(models.CharField):
# class Object(models.Model):
#     class Meta:
# class Relationship(models.Model):
#     class Meta:
# class Observation(models.Model):
#     class Meta:
# class Alias(models.Model):
#     class Meta:
# class Repository(models.Model):
#     class Meta:
# class Verb(models.Model):
#     class Meta:
# class VerbName(models.Model):
#     class Meta:
# class Property(models.Model):
#     class Meta:
# class Permission(models.Model):
#     class Meta:
# class Access(models.Model):
#     class Meta:
# class Player(models.Model):
#     class Meta:
# class Task(models.Model):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def annotated(self):
#     def name(self):
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def actor(self):
#     def entity(self):
#     def origin(self):
#     def __str__(self):
#     def __str__(self):
#     def is_authenticated(self):
#     def is_active(self):
#     def is_staff(self):
#     def is_superuser(self):
#     def has_module_perms(self, app):
#     def has_perm(self, perm):
#     def email(self):
# 
# Path: antioch/plugins/editors/tasks.py
# def openeditor(user_id, object_id, type, name):
# def openaccess(user_id, object_id, type, name):
# def modifyobject(user_id, object, name, location, parents, owner):
# def modifyverb(user_id, object_id, verb_id, names, code, ability, method, owner):
# def removeverb(user_id, object_id, verb_name):
# def removeproperty(user_id, object_id, property_name):
# def modifyproperty(user_id, object_id, property_id, name, value, type, owner):
# def modifyaccess(user_id, object_id, type, access):
# def getobjectdetails(user_id, object_id):


# Path: antioch/plugins/editors/forms.py
from django import forms
from django.forms import widgets
from django.forms.models import BaseModelFormSet
from dal import autocomplete
from antioch.core import models
from antioch.plugins.editors import tasks

            user_id        = self.user_id,
            object        = self.instance.origin.id,
            property_id = self.instance.id,
            name        = self.cleaned_data['name'],
            value        = self.cleaned_data['value'],
            type        = self.cleaned_data['type'],
            owner        = self.cleaned_data['owner'],
        ).get(timeout=5)
        return self

class VerbForm(AuthenticatedModelForm):
    class Meta:
        model = models.Verb
        exclude = ('origin',)
        autocomplete_fields = ('owner',)
        widgets = {
            'owner': autocomplete.ModelSelect2(url='object-autocomplete'),
        }
    
    names = forms.CharField()
    code = forms.CharField(widget=widgets.HiddenInput)
    
    def clean_owner(self):
        value = self.cleaned_data['owner']
        return value.id if value else None
    
    def _post_clean(self):
        pass
    
    def save(self, force_insert=False, force_update=False, commit=True):

        tasks.modifyverb.delay(