<commit_before>
from django.http import *
from django.forms import ModelForm
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.forms.models import modelform_factory

from objectapp.models import *
from objectapp.forms import *

from gstudio.models import *
from gstudio.admin.forms import *

#http://1192.168.127.12:8000/media/img/puppy.jpeg

def MakeForm(model_cls, *args, **kwargs):
	class ContextForm(ModelForm):
		class Meta:
			model = model_cls.values()[0]
			fields = ('value',)
		# def __init__(self, *args, **kwargs):
		# 	super(ContextForm,self).__init__(*args, **kwargs)
			
	return ContextForm(*args, **kwargs)

def dynamic_save(request, attit, memtit):
	rdict ={}
	savedict = {}
	memtit = NID.objects.get(title = str(memtit))
	name = memtit.ref

	absolute_url_node = name.get_absolute_url()

	at = Attributetype.objects.get(title = str(attit))
	dt = str(at.get_dataType_display())
	MyModel = eval('Attribute'+dt)

	print getattr(models , dt)

	list1 = []

	rdict.update({str(at.title):MyModel})
	
	print "rdict",str(rdict)<commit_msg>Minor syntax changes in DynamicAT<commit_after>
from django.http import *
from django.forms import ModelForm
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.forms.models import modelform_factory

from objectapp.models import *
from objectapp.forms import *

from gstudio.models import *
from gstudio.admin.forms import *



def MakeForm(model_cls, *args, **kwargs):
	class ContextForm(ModelForm):
		class Meta:
			model = model_cls.values()[0]
			fields = ('value',)
		# def __init__(self, *args, **kwargs):
		# 	super(ContextForm,self).__init__(*args, **kwargs)
			
	return ContextForm(*args, **kwargs)

def dynamic_save(request, attit, memtit):
	rdict ={}
	savedict = {}
	memtit = NID.objects.get(title = str(memtit))
	name = memtit.ref

	absolute_url_node = name.get_absolute_url()

	at = Attributetype.objects.get(title = str(attit))
	dt = str(at.get_dataType_display())
	MyModel = eval('Attribute'+dt)

	print getattr(models , dt)

	list1 = []

	rdict.update({str(at.title):MyModel})
	
	print "rdict",str(rdict)
{'fraction_non_alphanumeric': 0.12897282358360201, 'fraction_numerical': 0.009212344541685858, 'mean_word_length': 5.2057142857142855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5690404', 'n_tokens_mistral': 786, 'n_tokens_neox': 730, 'n_words': 164}