@@ -825,21 +825,6 @@ def make_DelegatingCaster(postgres):
825
825
"""
826
826
class DelegatingCaster (CompositeCaster ):
827
827
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
-
843
828
def parse (self , s , curs , retry = False ):
844
829
# Override to protect against race conditions:
845
830
# https://github.com/gratipay/postgres.py/issues/26
@@ -864,6 +849,21 @@ def parse(self, s, curs, retry=False):
864
849
865
850
return self .make (values )
866
851
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
+
867
867
return DelegatingCaster
868
868
869
869
0 commit comments