def record_stat(key, request, **data):
 if ('__recorded' in data):
  recorded = data.pop('__recorded')
 else:
  recorded = datetime.datetime.utcnow()
 if (not data):
  raise ValueError('You should at least define one value')
 record = MonolithRecord(key=key, user_hash=get_user_hash(request), recorded=recorded, value=json.dumps(data))
 record.save()
 return record

def record_stat ( key , request , ** data ) : if ( '__recorded' in data ) : recorded = data . pop ( '__recorded' ) else : recorded = datetime . datetime . utcnow ( ) if ( not data ) : raise ValueError ( 'You should at least define one value' ) record = MonolithRecord ( key = key , user_hash = get_user_hash ( request ) , recorded = recorded , value = json . dumps ( data ) ) record . save ( ) return record
create a new record in the database with the given values .