Changeset 157

Show
Ignore:
Timestamp:
08/07/10 16:20:33 (18 months ago)
Author:
phil
Message:

allow for multiple non kwargs to be in 'new'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • rdfalchemy/trunk/rdfalchemy/rdfsSubject.py

    r153 r157  
    4242    _weakrefs = WeakValueDictionary() 
    4343     
    44     def __new__(cls, resUri = None, schemaGraph=None, **kwargs): 
     44    def __new__(cls, resUri = None, schemaGraph=None, *args, **kwargs): 
    4545        if not resUri or isinstance(resUri, BNode) or issubclass(cls, BNode):  # create a bnode 
    4646            obj = BNode.__new__(cls, resUri) 
     
    6262            raise AttributeError("cannot construct rdfSubject from %s"%(str(resUri))) 
    6363         
    64                 # At this point we have an obj to return...but we might want to look deeper 
    65                 # if there is an RDF:type entry on the Graph, find the mapped subclass and return 
    66                 # an object of that new type 
     64        # At this point we have an obj to return...but we might want to look deeper 
     65        # if there is an RDF:type entry on the Graph, find the mapped subclass and return 
     66        # an object of that new type 
    6767        if resUri: 
    6868            rdf_type = obj[RDF.type] 
     
    7575            subclass = cls 
    7676         
    77                 # improve this do do some kind of hash with classname?? 
    78                 # this uses _weakrefs to allow us to return an existing object 
    79                 # rather than copies  
     77        # improve this do do some kind of hash with classname?? 
     78        # this uses _weakrefs to allow us to return an existing object 
     79        # rather than copies  
    8080        md5id = obj.md5_term_hash() 
    8181        newobj = rdfsSubject._weakrefs.get(md5id,None)