@@ -825,21 +825,6 @@ def make_DelegatingCaster(postgres):
825825 """
826826 class DelegatingCaster (CompositeCaster ):
827827
828- def make (self , values ):
829- # Override to delegate to the model registry.
830- if self .name not in postgres .model_registry :
831-
832- # This is probably a bug, not a normal user error. It means
833- # we've called register_composite for this typname without also
834- # registering with model_registry.
835-
836- raise NotImplementedError
837-
838- ModelSubclass = postgres .model_registry [self .name ]
839- record = dict (zip (self .attnames , values ))
840- instance = ModelSubclass (record )
841- return instance
842-
843828 def parse (self , s , curs , retry = False ):
844829 # Override to protect against race conditions:
845830 # https://github.com/gratipay/postgres.py/issues/26
@@ -864,6 +849,21 @@ def parse(self, s, curs, retry=False):
864849
865850 return self .make (values )
866851
852+ def make (self , values ):
853+ # Override to delegate to the model registry.
854+ if self .name not in postgres .model_registry :
855+
856+ # This is probably a bug, not a normal user error. It means
857+ # we've called register_composite for this typname without also
858+ # registering with model_registry.
859+
860+ raise NotImplementedError
861+
862+ ModelSubclass = postgres .model_registry [self .name ]
863+ record = dict (zip (self .attnames , values ))
864+ instance = ModelSubclass (record )
865+ return instance
866+
867867 return DelegatingCaster
868868
869869
0 commit comments