Skip to content

DjangoDetector

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/detectors/django-detector.ts

Django Detector

Methods

MethodSignatureReturns
detectViewsdetectViews(entities: Entity[])DetectedDjangoView[]
detectSerializersdetectSerializers(entities: Entity[])DetectedDjangoSerializer[]
detectModelsdetectModels(entities: Entity[])DetectedDjangoModel[]
getViewSummarygetViewSummary(view: DetectedDjangoView)string

Where it refuses work

  • DjangoDetector stops the work with an early return when !match, in 3 places.
  • DjangoDetector stops the work with an early return when !/views\.py$/i.test(filePath).
  • DjangoDetector stops the work with an early return when !/models\.py$/i.test(filePath).
  • DjangoDetector stops the work with an early return when /ViewSet/.test(code).
  • DjangoDetector stops the work with an early return when /APIView/.test(code).
  • DjangoDetector stops the work with an early return when /class\s+\w+\s*\(/.test(code).

Was this page helpful?

Download as PDF