@@ -151,8 +151,9 @@ def _allow_edges(self):
151
151
152
152
@abstractmethod
153
153
def raw_queryset (self ):
154
+ """Returns the RawQueryset for this query. Should be extended in child classes"""
154
155
155
- # Set the clases here, rather than in init so that we don't keep adding to the
156
+ # Set the query clauses here, rather than in init so that we don't keep adding to the
156
157
# clauses each time we check/utilize raw_queryset()
157
158
self .where_clauses_part_1 = ""
158
159
self .where_clauses_part_2 = ""
@@ -167,17 +168,22 @@ def raw_queryset(self):
167
168
return
168
169
169
170
def id_list (self ):
171
+ """Returns a list of ids in the resulting query"""
170
172
return [item .pk for item in self .raw_queryset ()]
171
173
172
174
def __str__ (self ):
175
+ """Returns a string representation of the RawQueryset"""
173
176
return str (self .raw_queryset ())
174
177
175
178
def __repr__ (self ):
179
+ """Returns a string representation of the RawQueryset"""
176
180
return str (self .raw_queryset ())
177
181
178
182
179
183
class AncestorQuery (BaseQuery ):
180
- """Ancestor Query Class"""
184
+ """
185
+ Ancestor Query Class
186
+ """
181
187
182
188
def __init__ (self , ** kwargs ):
183
189
super ().__init__ (** kwargs )
@@ -303,7 +309,9 @@ def raw_queryset(self):
303
309
304
310
305
311
class DescendantQuery (BaseQuery ):
306
- """Descendant Query Class"""
312
+ """
313
+ Descendant Query Class
314
+ """
307
315
308
316
def __init__ (self , ** kwargs ):
309
317
super ().__init__ (** kwargs )
@@ -423,7 +431,9 @@ def raw_queryset(self):
423
431
424
432
425
433
class ConnectedGraphQuery (BaseQuery ):
426
- """Queries for the entire graph of nodes connected to the provided instance node"""
434
+ """
435
+ Queries for the entire graph of nodes connected to the provided instance node
436
+ """
427
437
428
438
def __init__ (self , ** kwargs ):
429
439
super ().__init__ (** kwargs )
@@ -477,7 +487,9 @@ def raw_queryset(self):
477
487
478
488
479
489
class UpwardPathQuery (BaseQuery ):
480
- """Upward Path Query Class"""
490
+ """
491
+ Upward Path Query Class
492
+ """
481
493
482
494
def __init__ (self , ** kwargs ):
483
495
super ().__init__ (** kwargs )
@@ -586,7 +598,9 @@ def raw_queryset(self):
586
598
587
599
588
600
class DownwardPathQuery (BaseQuery ):
589
- """Downward Path Query Class"""
601
+ """
602
+ Downward Path Query Class
603
+ """
590
604
591
605
def __init__ (self , ** kwargs ):
592
606
super ().__init__ (** kwargs )
0 commit comments