コード例 #1
0
def publish_rdf( **kwargs) :
    obj = kwargs['instance']
    ct = ContentType.objects.get_for_model(obj)
    oml = ObjectMapping.objects.filter(content_type=ct)
    result = publish( obj, ct.name, oml) 
    logger.debug(
            "Persisting RDF for {} of type {} status {} body {}".format(obj,ct,result.status_code,result.content))
コード例 #2
0
ファイル: utils.py プロジェクト: markdoerr/django-rdf-io
def publish_rdf( **kwargs) :
    obj = kwargs['instance']
    try:
        if obj.skip_post_save :
            return
    except: # false or not supported
        pass
    ct = ContentType.objects.get_for_model(obj)
    oml = ObjectMapping.objects.filter(content_type=ct)
    result = publish( obj, ct.name, oml, None) 
    logger.debug(
            "Persisting RDF for {} of type {} status {} body {}".format(obj,ct,result.status_code,result.content))
    print("Persisting RDF for {} of type {} status {} body {}".format(obj,ct,result.status_code,result.content))
コード例 #3
0
def publish_rdf( **kwargs) :
    obj = kwargs['instance']
    try:
        if obj.skip_post_save :
            return
    except: # false or not supported
        pass
    ct = ContentType.objects.get_for_model(obj)
    oml = ObjectMapping.objects.filter(content_type=ct)
    result = publish( obj, ct.name, oml, None) 
    logger.debug(
            "Persisting RDF for {} of type {} status {} body {}".format(obj,ct,result.status_code,result.content))
    print            "Persisting RDF for {} of type {} status {} body {}".format(obj,ct,result.status_code,result.content)
コード例 #4
0
ファイル: manage.py プロジェクト: tobby2002/django-rdf-io
def do_sync_remote(formodel, ct, rdfstore):

    oml = ObjectMapping.objects.filter(content_type=ct)
    modelclass = ct.model_class()
    for obj in modelclass.objects.all():
        publish(obj, formodel, oml, rdfstore)
コード例 #5
0
def do_sync_remote(formodel, ct ,rdfstore):

    oml = ObjectMapping.objects.filter(content_type=ct)
    modelclass = ct.model_class()
    for obj in modelclass.objects.all() :
        publish( obj, formodel, oml, rdfstore)