@@ -101,29 +101,19 @@ class CollectionReferencesView(CollectionBaseView,
101101 ):
102102 serializer_class = CollectionDetailSerializer
103103
104- print 'CollectionReferencesView'
105-
106104 def initialize (self , request , path_info_segment , ** kwargs ):
107- print 'CollectionReferencesView initialize'
108- print 'CollectionReferencesView initialize request: ' , request
109- print 'CollectionReferencesView initialize path_info_segment: ' , path_info_segment
110- print 'CollectionReferencesView initialize kwargs: ' , kwargs
105+
111106 if request .method in ['GET' , 'HEAD' ]:
112107 self .permission_classes = (CanViewConceptDictionary ,)
113108 else :
114109 self .permission_classes = (CanEditConceptDictionary ,)
115110 super (CollectionReferencesView , self ).initialize (request , path_info_segment , ** kwargs )
116111
117112 def get_level (self ):
118- print 'CollectionReferencesView get_level'
119113 return 1
120114
121115 def update (self , request , * args , ** kwargs ):
122- print 'CollectionReferencesView update'
123- print 'CollectionReferencesView update request: ' , request
124- print 'CollectionReferencesView update request DATA: ' , request .DATA
125- print 'CollectionReferencesView update args: ' , args
126- print 'CollectionReferencesView update kwargs: ' , kwargs
116+
127117 if not self .parent_resource :
128118 return HttpResponse (status = status .HTTP_405_METHOD_NOT_ALLOWED )
129119
@@ -139,16 +129,6 @@ def update(self, request, *args, **kwargs):
139129
140130 adding_all = mapping_expressions == '*' or concept_expressions == '*'
141131
142- print 'CollectionReferencesView update data: ' , data
143- print 'CollectionReferencesView update expressions: ' , expressions
144- print 'CollectionReferencesView update concept_expressions: ' , concept_expressions
145- print 'CollectionReferencesView update mapping_expressions: ' , mapping_expressions
146- print 'CollectionReferencesView update cascade_mappings_flag: ' , cascade_mappings_flag
147- print 'CollectionReferencesView update cascade_mappings: ' , cascade_mappings
148- print 'CollectionReferencesView update host_url: ' , host_url
149- print 'CollectionReferencesView update adding_all: ' , adding_all
150-
151-
152132 if adding_all :
153133 add_references .delay (
154134 self .serializer_class , self .request .user , data , self .parent_resource , host_url , cascade_mappings
@@ -160,8 +140,6 @@ def update(self, request, *args, **kwargs):
160140 self .serializer_class , self .request .user , data , self .parent_resource , host_url , cascade_mappings
161141 )
162142
163- print 'CollectionReferencesView update added_references: ' , added_references
164-
165143 all_expression = expressions + concept_expressions + mapping_expressions
166144
167145 added_expression = [references .expression for references in added_references ]
@@ -171,32 +149,22 @@ def update(self, request, *args, **kwargs):
171149
172150 for expression in added_original_expression :
173151 response_item = self .create_response_item (added_expression , errors , expression )
174- print 'CollectionReferencesView update response_item: ' , response_item
175152 if response_item :
176153 response .append (response_item )
177154
178- print 'CollectionReferencesView update all_expression: ' , all_expression
179- print 'CollectionReferencesView update added_expression: ' , added_expression
180- print 'CollectionReferencesView update added_original_expression: ' , added_original_expression
181- print 'CollectionReferencesView update response: ' , response
182-
183155 return Response (response , status = status .HTTP_200_OK )
184156
185157 def create_response_item (self , added_references , errors , expression ):
186- print 'CollectionReferencesView create_response_item'
187158 adding_expression_failed = len (errors ) > 0 and errors [0 ].has_key (expression )
188159 if adding_expression_failed :
189160 return self .create_error_message (errors , expression )
190161 return self .create_success_message (added_references , expression )
191162
192163 def create_success_message (self , added_references , expression ):
193- print 'CollectionReferencesView create_success_message'
194164 message = self .select_update_message (expression )
195165
196166 references = filter (lambda reference : reference .startswith (expression ), added_references )
197167
198- print 'CollectionReferencesView create_success_message message: ' , message
199- print 'CollectionReferencesView create_success_message references: ' , references
200168 if len (references ) < 1 :
201169 return
202170
@@ -207,24 +175,18 @@ def create_success_message(self, added_references, expression):
207175 }
208176
209177 def create_error_message (self , errors , expression ):
210- print 'CollectionReferencesView create_error_message'
211178 error_message = errors [0 ].get (expression , {})
212- print 'CollectionReferencesView create_error_message errors: ' , errors
213- print 'CollectionReferencesView create_error_message error_message: ' , error_message
214- print 'CollectionReferencesView create_error_message expression: ' , expression
215179 return {
216180 'added' : False ,
217181 'expression' : expression ,
218182 'message' : error_message
219183 }
220184
221185 def retrieve (self , request , * args , ** kwargs ):
222- print 'CollectionReferencesView retrieve'
223186 self .serializer_class = CollectionReferenceSerializer
224187 return self .list (request , * args , ** kwargs )
225188
226189 def get_queryset (self ):
227- print 'CollectionReferencesView get_queryset'
228190 search_query = self .request .QUERY_PARAMS .get ('q' , '' )
229191 sort = self .request .QUERY_PARAMS .get ('search_sort' , 'ASC' )
230192
@@ -233,7 +195,6 @@ def get_queryset(self):
233195 return references if sort == 'ASC' else list (reversed (references ))
234196
235197 def destroy (self , request , * args , ** kwargs ):
236- print 'CollectionReferencesView destroy'
237198 if not self .parent_resource :
238199 return HttpResponse (status = status .HTTP_405_METHOD_NOT_ALLOWED )
239200
@@ -253,17 +214,13 @@ def destroy(self, request, *args, **kwargs):
253214 return Response ({'message' : 'ok!' }, status = status .HTTP_200_OK )
254215
255216 def get_related_mappings_with_version_information (self , cascade_mappings_flag , references ):
256- print 'CollectionReferencesView get_related_mappings_with_version_information'
257- print 'CollectionReferencesView get_related_mappings_with_version_information references: ' , references
217+
258218 related_mappings = []
259219
260220 for reference in references :
261221 if CollectionReferenceUtils .is_concept (reference ):
262222 concept_id = CollectionReferenceUtils .get_concept_id_by_version_information (reference )
263223 related_mappings += Concept .objects .get (id = concept_id ).get_unidirectional_mappings ()
264- print 'CollectionReferencesView get_related_mappings_with_version_information concept_id: ' , concept_id
265- print 'CollectionReferencesView get_related_mappings_with_version_information reference: ' , reference
266- print 'CollectionReferencesView get_related_mappings_with_version_information related_mappings: ' , related_mappings
267224
268225 return self .get_version_information_of_related_mappings (related_mappings )
269226
@@ -278,7 +235,6 @@ def get_version_information_of_related_mappings(self, related_mappings):
278235 return related_mappings_with_version
279236
280237 def cascade_mapping_resolver (self , cascade_mappings_flag ):
281- print 'CollectionReferencesView cascade_mapping_resolver'
282238 cascade_mappings_flag_resolver = {
283239 'none' : False ,
284240 'sourcemappings' : True
@@ -287,7 +243,6 @@ def cascade_mapping_resolver(self, cascade_mappings_flag):
287243 return cascade_mappings_flag_resolver .get (cascade_mappings_flag .lower (), False )
288244
289245 def select_update_message (self , expression ):
290- print 'CollectionReferencesView select_update_message'
291246 adding_head_version = not CollectionReference .version_specified (expression )
292247
293248 expression_parts = expression .split ('/' )
@@ -298,20 +253,14 @@ def select_update_message(self, expression):
298253
299254 resource_name = expression_parts [6 ]
300255
301- print 'CollectionReferencesView select_update_message adding_head_version: ' , adding_head_version
302- print 'CollectionReferencesView select_update_message expression_parts: ' , expression_parts
303- print 'CollectionReferencesView select_update_message resource_type: ' , resource_type
304-
305256 return self .version_added_message_by_type (resource_name , self .parent_resource .name , resource_type )
306257
307258 def adding_to_head_message_by_type (self , resource_type ):
308- print 'CollectionReferencesView adding_to_head_message_by_type'
309259 if resource_type == 'concepts' :
310260 return HEAD_OF_CONCEPT_ADDED_TO_COLLECTION
311261 return HEAD_OF_MAPPING_ADDED_TO_COLLECTION
312262
313263 def version_added_message_by_type (self , resource_name , collection_name , resource_type ):
314- print 'CollectionReferencesView version_added_message_by_type'
315264 if resource_type == 'concepts' :
316265 return CONCEPT_ADDED_TO_COLLECTION_FMT .format (resource_name , collection_name )
317266 return MAPPING_ADDED_TO_COLLECTION_FMT .format (resource_name , collection_name )
0 commit comments