Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 28.08 KB | None | 0 0
  1. class ArchiveTopics(GdsModel):
  2.     reason = models.CharField(max_length=255)
  3.  
  4.     class Meta:
  5.         managed = False
  6.         db_table = 'archive_topics'
  7.         gds_database = 'gds'
  8.  
  9.  
  10. class Areas(GdsModel):
  11.     name = models.CharField(max_length=255)
  12.     plural_name = models.CharField(max_length=255)
  13.     parent_area = models.ForeignKey('self', models.DO_NOTHING, blank=True, null=True)
  14.     side = models.CharField(max_length=255)
  15.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by')
  16.     created_at = models.DateTimeField(blank=True, null=True)
  17.     updated_at = models.DateTimeField(blank=True, null=True)
  18.     has_archived = models.IntegerField()
  19.     archive_reason_topic = models.ForeignKey(ArchiveTopics, models.DO_NOTHING,
  20.                                              db_column='archive_reason_topic', blank=True,
  21.                                              null=True)
  22.     archive_reason_freetext = models.TextField()
  23.  
  24.     class Meta:
  25.         managed = False
  26.         db_table = 'areas'
  27.         gds_database = 'gds'
  28.  
  29.  
  30. class AreasCategoriesLookup(GdsModel):
  31.     area = models.ForeignKey(Areas, models.DO_NOTHING)
  32.     category = models.ForeignKey('Categories', models.DO_NOTHING)
  33.  
  34.     class Meta:
  35.         managed = False
  36.         db_table = 'areas_categories_lookup'
  37.         gds_database = 'gds'
  38.  
  39.  
  40. class AreasMediaLookup(GdsModel):
  41.     area = models.ForeignKey(Areas, models.DO_NOTHING)
  42.     side_reference = models.CharField(max_length=50)
  43.     media = models.ForeignKey('Medias', models.DO_NOTHING)
  44.  
  45.     class Meta:
  46.         managed = False
  47.         db_table = 'areas_media_lookup'
  48.         gds_database = 'gds'
  49.  
  50.  
  51. class BusinessHoldingGroups(GdsModel):
  52.     name = models.CharField(max_length=100)
  53.     created_at = models.DateTimeField()
  54.     updated_at = models.DateTimeField()
  55.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  56.                                  null=True)
  57.  
  58.     class Meta:
  59.         managed = False
  60.         gds_database = 'gds'
  61.         db_table = 'business_holding_groups'
  62.  
  63.  
  64. class Categories(GdsModel):
  65.     cat_name = models.CharField(max_length=200)
  66.     description = models.TextField()
  67.     active = models.IntegerField(blank=True, null=True)
  68.     created_at = models.DateTimeField(blank=True, null=True)
  69.     updated_at = models.DateTimeField(blank=True, null=True)
  70.  
  71.     class Meta:
  72.         managed = False
  73.         gds_database = 'gds'
  74.         db_table = 'categories'
  75.  
  76.  
  77. class CategoriesCsLookup(GdsModel):
  78.     category = models.ForeignKey(Categories, models.DO_NOTHING)
  79.     cs = models.ForeignKey('Cs', models.DO_NOTHING, blank=True, null=True)
  80.     cs_template = models.ForeignKey('CsTemplates', models.DO_NOTHING, blank=True, null=True)
  81.     sort = models.IntegerField()
  82.  
  83.     class Meta:
  84.         managed = False
  85.         gds_database = 'gds'
  86.         db_table = 'categories_cs_lookup'
  87.  
  88.  
  89. class Cc(GdsModel):
  90.     hashed_id = models.CharField(max_length=40)
  91.     name = models.CharField(max_length=100)
  92.     description = models.TextField()
  93.     cog = models.ForeignKey('Co', models.DO_NOTHING, blank=True, null=True)
  94.     active = models.IntegerField()
  95.     required = models.IntegerField()
  96.     created_at = models.DateTimeField(blank=True, null=True)
  97.     updated_at = models.DateTimeField(blank=True, null=True)
  98.  
  99.     class Meta:
  100.         managed = False
  101.         gds_database = 'gds'
  102.         db_table = 'cc'
  103.  
  104.  
  105. class Cg(GdsModel):  # Care Giver
  106.     hashed_id = models.CharField(max_length=40)
  107.     title = models.CharField(max_length=20)
  108.     first_name = models.CharField(max_length=50)
  109.     last_name = models.CharField(max_length=50)
  110.     nickname = models.CharField(max_length=50)
  111.     pronoun = models.CharField(max_length=50)
  112.     noun = models.CharField(max_length=50)
  113.     description = models.TextField()
  114.     active = models.IntegerField()
  115.     created_at = models.DateTimeField(blank=True, null=True)
  116.     updated_at = models.DateTimeField(blank=True, null=True)
  117.     added_by = models.IntegerField(blank=True, null=True)
  118.     deleted_at = models.DateTimeField(blank=True, null=True)
  119.  
  120.     class Meta:
  121.         managed = False
  122.         gds_database = 'gds'
  123.         db_table = 'cg'
  124.  
  125.     def __str__(self):
  126.         return self.title
  127.  
  128.  
  129. class CgLookup(GdsModel):
  130.     cg = models.ForeignKey(Cg, models.DO_NOTHING)
  131.     fk_table = models.CharField(max_length=200)
  132.     fk_id = models.IntegerField()
  133.     pref = models.IntegerField()
  134.     created_at = models.DateTimeField()
  135.     updated_at = models.DateTimeField(blank=True, null=True)
  136.  
  137.     class Meta:
  138.         managed = False
  139.         gds_database = 'gds'
  140.         db_table = 'cg_lookup'
  141.  
  142.  
  143. class CgQualifications(GdsModel):
  144.     cg = models.ForeignKey(Cg, models.DO_NOTHING, related_name='qualifications')
  145.     type = models.CharField(max_length=21)
  146.     start_year = models.TextField()
  147.     end_year = models.TextField()
  148.     name = models.CharField(max_length=255)
  149.     edu = models.ForeignKey('EducationOrganizations', models.DO_NOTHING, blank=True, null=True)
  150.     city = models.ForeignKey('Cities', models.DO_NOTHING, blank=True, null=True)
  151.     country = models.ForeignKey('Countries', models.DO_NOTHING, blank=True, null=True)
  152.     created_at = models.DateTimeField()
  153.     updated_at = models.DateTimeField()
  154.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  155.                                  null=True)
  156.     deleted_at = models.DateTimeField(blank=True, null=True)
  157.  
  158.     class Meta:
  159.         managed = False
  160.         gds_database = 'gds'
  161.         db_table = 'cg_qualifications'
  162.  
  163.  
  164. class Cities(GdsModel):
  165.     name = models.CharField(max_length=100)
  166.  
  167.     class Meta:
  168.         managed = False
  169.         gds_database = 'gds'
  170.         db_table = 'cities'
  171.  
  172.  
  173. class Cn(GdsModel):
  174.     hashed_id = models.CharField(max_length=40)
  175.     name = models.CharField(max_length=100)
  176.     description = models.TextField()
  177.     cog = models.ForeignKey('Co', models.DO_NOTHING, blank=True, null=True)
  178.     active = models.IntegerField()
  179.     required = models.IntegerField()
  180.     created_at = models.DateTimeField(blank=True, null=True)
  181.     updated_at = models.DateTimeField(blank=True, null=True)
  182.  
  183.     class Meta:
  184.         managed = False
  185.         gds_database = 'gds'
  186.         db_table = 'cn'
  187.  
  188.  
  189. class Co(GdsModel):  # COG (is a category of Inventories)
  190.     hashed_id = models.CharField(max_length=40)
  191.     co = models.CharField(max_length=100)
  192.     description = models.TextField()
  193.     code = models.CharField(max_length=4, blank=True, null=True)
  194.     active = models.IntegerField()
  195.     created_at = models.DateTimeField(blank=True, null=True)
  196.     updated_at = models.DateTimeField(blank=True, null=True)
  197.     rank = models.IntegerField()
  198.     has_saved = models.IntegerField()
  199.     deleted_at = models.DateTimeField(blank=True, null=True)
  200.  
  201.     class Meta:
  202.         managed = False
  203.         gds_database = 'gds'
  204.         db_table = 'co'
  205.  
  206.     def __str__(self):
  207.         return self.co
  208.  
  209.  
  210. class CoCategoriesLookup(GdsModel):
  211.     co = models.ForeignKey(Co, models.DO_NOTHING)
  212.     category = models.ForeignKey(Categories, models.DO_NOTHING)
  213.  
  214.     class Meta:
  215.         managed = False
  216.         db_table = 'co_categories_lookup'
  217.         gds_database = 'gds'
  218.  
  219.  
  220. class CoCcLookup(GdsModel):
  221.     co_id = models.IntegerField()
  222.     cc_id = models.IntegerField()
  223.     created_at = models.DateTimeField(blank=True, null=True)
  224.     updated_at = models.DateTimeField(blank=True, null=True)
  225.  
  226.     class Meta:
  227.         managed = False
  228.         db_table = 'co_cc_lookup'
  229.         gds_database = 'gds'
  230.  
  231.  
  232. class CoCnLookup(GdsModel):
  233.     co_id = models.IntegerField()
  234.     cn_id = models.IntegerField()
  235.     created_at = models.DateTimeField(blank=True, null=True)
  236.     updated_at = models.DateTimeField(blank=True, null=True)
  237.  
  238.     class Meta:
  239.         managed = False
  240.         db_table = 'co_cn_lookup'
  241.         gds_database = 'gds'
  242.  
  243.  
  244. class CofCriteriaLookup(GdsModel):
  245.     cof = models.ForeignKey('gds.Cof', models.DO_NOTHING)
  246.     criteria = models.ForeignKey('CriteriaTypes', models.DO_NOTHING)
  247.     set_value = models.CharField(max_length=255)
  248.     created_at = models.DateTimeField(blank=True, null=True)
  249.     updated_at = models.DateTimeField(blank=True, null=True)
  250.  
  251.     class Meta:
  252.         managed = False
  253.         db_table = 'cof_criteria_lookup'
  254.         gds_database = 'gds'
  255.  
  256.  
  257. class Complexities(GdsModel):
  258.     complexity = models.CharField(max_length=150)
  259.     complexity_type = models.ForeignKey('ComplexityTypes', models.DO_NOTHING, blank=True, null=True)
  260.     active = models.IntegerField()
  261.     created_at = models.DateTimeField(blank=True, null=True)
  262.     updated_at = models.DateTimeField(blank=True, null=True)
  263.  
  264.     class Meta:
  265.         managed = False
  266.         gds_database = 'gds'
  267.         db_table = 'complexities'
  268.  
  269.  
  270. class ComplexityTypes(GdsModel):
  271.     type = models.CharField(max_length=200, blank=True, null=True)
  272.     active = models.IntegerField()
  273.     created_at = models.DateTimeField(blank=True, null=True)
  274.     updated_at = models.DateTimeField(blank=True, null=True)
  275.  
  276.     class Meta:
  277.         managed = False
  278.         gds_database = 'gds'
  279.         db_table = 'complexity_types'
  280.  
  281.  
  282. class Config(GdsModel):
  283.     config_name = models.CharField(max_length=255)
  284.     config_value = models.CharField(max_length=255)
  285.  
  286.     class Meta:
  287.         managed = False
  288.         db_table = 'config'
  289.         gds_database = 'gds'
  290.  
  291.  
  292. class Countries(GdsModel):
  293.     country_code = models.CharField(max_length=2)
  294.     country_name = models.CharField(max_length=45)
  295.  
  296.     class Meta:
  297.         managed = False
  298.         gds_database = 'gds'
  299.         db_table = 'countries'
  300.  
  301.     def __str__(self):
  302.         return self.country_name
  303.  
  304.  
  305. class Cp(GdsModel):  # care partner
  306.     hashed_id = models.CharField(max_length=40)
  307.     cp_name = models.CharField(max_length=100)
  308.     destination = models.ForeignKey('Destinations', models.DO_NOTHING, db_column='destination',
  309.                                     blank=True, null=True)
  310.     description = models.TextField()
  311.     code = models.CharField(max_length=4, blank=True, null=True)
  312.     type = models.CharField(max_length=8, blank=True, null=True)
  313.     bhg = models.ForeignKey(BusinessHoldingGroups, models.DO_NOTHING, blank=True, null=True)
  314.     transfer_cp = models.CharField(max_length=10, blank=True, null=True)
  315.     transfer_airport = models.CharField(max_length=10, blank=True, null=True)
  316.     discount = models.CharField(max_length=10, blank=True, null=True)
  317.     alt = models.IntegerField()
  318.     active = models.IntegerField()
  319.     rank = models.IntegerField()
  320.     created_at = models.DateTimeField(blank=True, null=True)
  321.     updated_at = models.DateTimeField(blank=True, null=True)
  322.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  323.                                  null=True)
  324.     deleted_at = models.DateTimeField(blank=True, null=True)
  325.  
  326.     class Meta:
  327.         managed = False
  328.         gds_database = 'gds'
  329.         db_table = 'cp'
  330.  
  331.     def __str__(self):
  332.         return self.cp_name
  333.  
  334.  
  335. class CpCategoriesLookup(GdsModel):
  336.     cp = models.ForeignKey(Cp, models.DO_NOTHING)
  337.     category = models.ForeignKey(Categories, models.DO_NOTHING)
  338.  
  339.     class Meta:
  340.         managed = False
  341.         gds_database = 'gds'
  342.         db_table = 'cp_categories_lookup'
  343.  
  344.  
  345. class CriteriaTypes(GdsModel):
  346.     criteria = models.CharField(max_length=200)
  347.     cost_driver = models.IntegerField(blank=True, null=True)
  348.     active = models.IntegerField()
  349.     private = models.IntegerField()
  350.     rank = models.IntegerField(blank=True, null=True)
  351.     created_at = models.DateTimeField(blank=True, null=True)
  352.     updated_at = models.DateTimeField(blank=True, null=True)
  353.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  354.                                  null=True)
  355.  
  356.     class Meta:
  357.         managed = False
  358.         gds_database = 'gds'
  359.         db_table = 'criteria_types'
  360.  
  361.  
  362. class Cs(GdsModel):
  363.     name = models.CharField(max_length=255)
  364.     type = models.CharField(max_length=11, blank=True, null=True)
  365.     is_substep = models.IntegerField()
  366.     created_at = models.DateTimeField(blank=True, null=True)
  367.     updated_at = models.DateTimeField(blank=True, null=True)
  368.  
  369.     class Meta:
  370.         managed = False
  371.         gds_database = 'gds'
  372.         db_table = 'cs'
  373.  
  374.     def __str__(self):
  375.         return self.name
  376.  
  377.  
  378. class CsSubstepsLookup(GdsModel):
  379.     cs = models.ForeignKey(Cs, models.DO_NOTHING, related_name="care_steps")
  380.     substep = models.ForeignKey(Cs, models.DO_NOTHING)
  381.     sort = models.IntegerField()
  382.  
  383.     class Meta:
  384.         managed = False
  385.         gds_database = 'gds'
  386.         db_table = 'cs_substeps_lookup'
  387.  
  388.  
  389. class CsTemplateCs(GdsModel):
  390.     cs = models.ForeignKey(Cs, models.DO_NOTHING)
  391.     cs_template = models.ForeignKey('CsTemplates', models.DO_NOTHING)
  392.     sort = models.IntegerField()
  393.  
  394.     class Meta:
  395.         managed = False
  396.         gds_database = 'gds'
  397.         db_table = 'cs_template_cs'
  398.  
  399.  
  400. class CsTemplates(GdsModel):
  401.     name = models.CharField(max_length=255)
  402.     created_at = models.DateTimeField(blank=True, null=True)
  403.     updated_at = models.DateTimeField(blank=True, null=True)
  404.  
  405.     class Meta:
  406.         managed = False
  407.         gds_database = 'gds'
  408.         db_table = 'cs_templates'
  409.  
  410.  
  411. class Currency(GdsModel):
  412.     country = models.ForeignKey(Countries, models.DO_NOTHING, db_column='country')
  413.     currency = models.CharField(max_length=100, blank=True, null=True)
  414.     currency_code = models.CharField(max_length=100)
  415.     currency_symbol = models.CharField(max_length=100)
  416.     active = models.IntegerField()
  417.     created_at = models.DateTimeField(blank=True, null=True)
  418.     updated_at = models.DateTimeField(blank=True, null=True)
  419.  
  420.     class Meta:
  421.         managed = False
  422.         gds_database = 'gds'
  423.         db_table = 'currency'
  424.  
  425.     def __str__(self):
  426.         return self.currency
  427.  
  428.  
  429. class Destinations(GdsModel):
  430.     hashed_id = models.CharField(max_length=40)
  431.     country = models.ForeignKey(Countries, models.DO_NOTHING, blank=True, null=True)
  432.     name = models.CharField(max_length=50)
  433.     active = models.IntegerField()
  434.     description = models.TextField()
  435.     rank = models.IntegerField()
  436.     created_at = models.DateTimeField(blank=True, null=True)
  437.     updated_at = models.DateTimeField(blank=True, null=True)
  438.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  439.                                  null=True)
  440.  
  441.     class Meta:
  442.         managed = False
  443.         gds_database = 'gds'
  444.         db_table = 'destinations'
  445.  
  446.     def __str__(self):
  447.         return '{} - {}'.format(self.name, self.country)
  448.  
  449.  
  450. class DiscountPolicies(GdsModel):
  451.     cp = models.ForeignKey(Cp, models.DO_NOTHING)
  452.     min_price = models.CharField(max_length=100)
  453.     amount = models.CharField(max_length=100)
  454.     category = models.ForeignKey(Categories, models.DO_NOTHING, blank=True, null=True)
  455.     rule = models.CharField(max_length=255)
  456.  
  457.     class Meta:
  458.         managed = False
  459.         gds_database = 'gds'
  460.         db_table = 'discount_policies'
  461.  
  462.  
  463. class EducationOrganizations(GdsModel):
  464.     name = models.CharField(max_length=200)
  465.     created_at = models.DateTimeField()
  466.     updated_at = models.DateTimeField()
  467.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  468.                                  null=True)
  469.     deleted_at = models.DateTimeField(blank=True, null=True)
  470.  
  471.     class Meta:
  472.         managed = False
  473.         gds_database = 'gds'
  474.         db_table = 'education_organizations'
  475.  
  476.  
  477. class Inventory(GdsModel):  # also knows as Co
  478.  
  479.     argument_types = ['co.co']  # used for search
  480.  
  481.     hashed_id = models.CharField(max_length=40)
  482.     cp = models.ForeignKey(Cp, models.DO_NOTHING, blank=True, null=True)
  483.     co = models.ForeignKey(Co, models.DO_NOTHING, blank=True, null=True)
  484.     cg = models.ForeignKey(Cg, models.DO_NOTHING, blank=True, null=True)
  485.     min_price = models.DecimalField(max_digits=15, decimal_places=2)
  486.     max_price = models.DecimalField(max_digits=15, decimal_places=2)
  487.     preop = models.IntegerField()
  488.     currency = models.ForeignKey(Currency, models.DO_NOTHING, blank=True, null=True)
  489.     cat = models.ForeignKey(Categories, models.DO_NOTHING, blank=True, null=True)
  490.     notes = models.CharField(max_length=255, blank=True, null=True)
  491.     consultation = models.CharField(max_length=100, blank=True, null=True)
  492.     planned_tests = models.CharField(max_length=100, blank=True, null=True)
  493.     possible_tests = models.CharField(max_length=100, blank=True, null=True)
  494.     type = models.CharField(max_length=3)
  495.     night_icu = models.CharField(max_length=30, blank=True, null=True)
  496.     night_hospital = models.CharField(max_length=30, blank=True, null=True)
  497.     night_country = models.CharField(max_length=30, blank=True, null=True)
  498.     active = models.IntegerField()
  499.     package = models.IntegerField()
  500.     promo = models.IntegerField()
  501.     start_timestamp = models.DateTimeField(blank=True, null=True)
  502.     end_timestamp = models.DateTimeField(blank=True, null=True)
  503.     created_at = models.DateTimeField(blank=True, null=True)
  504.     updated_at = models.DateTimeField(blank=True, null=True)
  505.     session_id = models.CharField(max_length=100)
  506.     added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by')
  507.     has_saved = models.IntegerField()
  508.     has_archived = models.IntegerField()
  509.     archive_reason_topic = models.ForeignKey(ArchiveTopics, models.DO_NOTHING,
  510.                                              db_column='archive_reason_topic', blank=True,
  511.                                              null=True)
  512.     archive_reason_freetext = models.TextField(blank=True, null=True)
  513.     deleted_at = models.DateTimeField(blank=True, null=True)
  514.  
  515.     class Meta:
  516.         managed = False
  517.         gds_database = 'gds'
  518.         db_table = 'inventory'
  519.  
  520.     def __str__(self):
  521.         if self.co:
  522.             return self.co.co
  523.         return 'Invalid inventory
  524.  
  525.  
  526. class Cof(GdsModel):  # inventory fees
  527.    hashed_id = models.CharField(max_length=40)
  528.    name = models.CharField(max_length=255)
  529.    co = models.ForeignKey(Co, models.DO_NOTHING, blank=True, null=True)
  530.    cp = models.ForeignKey('Cp', models.DO_NOTHING, blank=True, null=True)
  531.    cg = models.ForeignKey(Cg, models.DO_NOTHING, blank=True, null=True)
  532.    min_price = models.CharField(max_length=100)
  533.    max_price = models.CharField(max_length=100)
  534.    currency = models.ForeignKey('Currency', models.DO_NOTHING, blank=True, null=True)
  535.    cat = models.ForeignKey(Categories, models.DO_NOTHING, blank=True, null=True)
  536.    notes = models.CharField(max_length=255)
  537.    type = models.CharField(max_length=3)
  538.    night_hospital = models.CharField(max_length=30)
  539.    night_country = models.CharField(max_length=30)
  540.    active = models.IntegerField()
  541.    package = models.IntegerField()
  542.    promo = models.IntegerField()
  543.    added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by')
  544.    start_timestamp = models.DateTimeField(blank=True, null=True)
  545.    end_timestamp = models.DateTimeField(blank=True, null=True)
  546.    created_at = models.DateTimeField(blank=True, null=True)
  547.    updated_at = models.DateTimeField(blank=True, null=True)
  548.    deleted_at = models.DateTimeField(blank=True, null=True)
  549.  
  550.    class Meta:
  551.        managed = False
  552.        gds_database = 'gds'
  553.        db_table = 'cof'
  554.  
  555.  
  556. class InventoryCcoLookup(GdsModel):
  557.    inventory = models.ForeignKey(Inventory, models.DO_NOTHING)
  558.    co = models.ForeignKey(Co, models.DO_NOTHING)
  559.  
  560.    class Meta:
  561.        managed = False
  562.        gds_database = 'gds'
  563.        db_table = 'inventory_cco_lookup'
  564.  
  565.  
  566. class InventoryCofLookup(GdsModel):
  567.    inventory = models.ForeignKey(Inventory, models.DO_NOTHING)
  568.    cof = models.ForeignKey(Cof, models.DO_NOTHING)
  569.    created_at = models.DateTimeField(blank=True, null=True)
  570.    updated_at = models.DateTimeField(blank=True, null=True)
  571.  
  572.    class Meta:
  573.        managed = False
  574.        gds_database = 'gds'
  575.        db_table = 'inventory_cof_lookup'
  576.  
  577.  
  578. class InventoryComplexitiesLookup(GdsModel):
  579.    complexity = models.ForeignKey(Complexities, models.DO_NOTHING)
  580.    inventory = models.ForeignKey(Inventory, models.DO_NOTHING)
  581.    created_at = models.DateTimeField(blank=True, null=True)
  582.    updated_at = models.DateTimeField(blank=True, null=True)
  583.  
  584.    class Meta:
  585.        managed = False
  586.        gds_database = 'gds'
  587.        db_table = 'inventory_complexities_lookup'
  588.  
  589.  
  590. class InventoryCriteriaLookup(GdsModel):
  591.    inventory = models.ForeignKey(Inventory, models.DO_NOTHING)
  592.    criteria = models.ForeignKey(CriteriaTypes, models.DO_NOTHING)
  593.    set_value = models.CharField(max_length=255)
  594.    cost_driver = models.IntegerField(blank=True, null=True)
  595.    created_at = models.DateTimeField()
  596.    updated_at = models.DateTimeField()
  597.  
  598.    def __str__(self):
  599.        return '{}: {}'.format(self.criteria.criteria, self.set_value)
  600.  
  601.    class Meta:
  602.        managed = False
  603.        gds_database = 'gds'
  604.        db_table = 'inventory_criteria_lookup'
  605.  
  606.  
  607. class InventorySources(GdsModel):
  608.    inventory = models.ForeignKey(Inventory, models.DO_NOTHING)
  609.    name = models.CharField(max_length=255, blank=True, null=True)
  610.    source = models.CharField(max_length=20, blank=True, null=True)
  611.    stamp = models.DateField(blank=True, null=True)
  612.    found_user = models.ForeignKey('Users', models.DO_NOTHING, blank=True, null=True)
  613.  
  614.    class Meta:
  615.        managed = False
  616.        gds_database = 'gds'
  617.        db_table = 'inventory_sources'
  618.  
  619.  
  620. class Knowledge(GdsModel):
  621.    hashed_id = models.CharField(max_length=40)
  622.    knowledge = models.TextField()
  623.    updated_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='updated_by', blank=True,
  624.                                   null=True)
  625.    has_archived = models.IntegerField()
  626.    archive_reason_topic = models.ForeignKey(ArchiveTopics, models.DO_NOTHING,
  627.                                             db_column='archive_reason_topic', blank=True,
  628.                                             null=True)
  629.    archive_reason_freetext = models.TextField(blank=True, null=True)
  630.    is_moderated = models.IntegerField()
  631.    email_sent = models.IntegerField()
  632.    updated_at = models.DateTimeField()
  633.    created_at = models.DateTimeField()
  634.  
  635.    class Meta:
  636.        managed = False
  637.        db_table = 'knowledge'
  638.        gds_database = 'gds'
  639.  
  640.  
  641. class KnowledgeMediaLookup(GdsModel):
  642.    knowledge = models.ForeignKey(Knowledge, models.DO_NOTHING)
  643.    custom_file_name = models.CharField(max_length=255)
  644.    media = models.ForeignKey('Medias', models.DO_NOTHING)
  645.  
  646.    class Meta:
  647.        managed = False
  648.        db_table = 'knowledge_media_lookup'
  649.        gds_database = 'gds'
  650.  
  651.  
  652. class KnowledgeSources(GdsModel):
  653.    knowledge = models.ForeignKey(Knowledge, models.DO_NOTHING)
  654.    name = models.CharField(max_length=255, blank=True, null=True)
  655.    source = models.CharField(max_length=20, blank=True, null=True)
  656.    stamp = models.DateField(blank=True, null=True)
  657.    found_user = models.ForeignKey('Users', models.DO_NOTHING, blank=True, null=True)
  658.  
  659.    class Meta:
  660.        managed = False
  661.        db_table = 'knowledge_sources'
  662.        gds_database = 'gds'
  663.  
  664.  
  665. class MediaLookup(GdsModel):
  666.    fk_table = models.CharField(max_length=200)
  667.    fk_id = models.IntegerField()
  668.    media = models.ForeignKey('Medias', models.DO_NOTHING)
  669.    created_at = models.DateTimeField()
  670.    updated_at = models.DateTimeField()
  671.  
  672.    class Meta:
  673.        managed = False
  674.        gds_database = 'gds'
  675.        db_table = 'media_lookup'
  676.  
  677.  
  678. class MediaTypes(GdsModel):
  679.    content_type = models.CharField(max_length=50)
  680.    created_at = models.DateTimeField()
  681.    updated_at = models.DateTimeField(blank=True, null=True)
  682.  
  683.    class Meta:
  684.        managed = False
  685.        gds_database = 'gds'
  686.        db_table = 'media_types'
  687.  
  688.  
  689. class Medias(GdsModel):
  690.    content_url = models.CharField(max_length=512)
  691.    media_type = models.ForeignKey(MediaTypes, models.DO_NOTHING, blank=True, null=True)
  692.    extension_type = models.CharField(max_length=5, blank=True, null=True)
  693.    caption = models.CharField(max_length=255)
  694.    is_title_photo = models.IntegerField()
  695.    is_logo = models.IntegerField()
  696.    is_profile = models.IntegerField()
  697.    is_icon = models.IntegerField()
  698.    created_at = models.DateTimeField()
  699.    updated_at = models.DateTimeField(blank=True, null=True)
  700.    added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by')
  701.    deleted_at = models.DateTimeField(blank=True, null=True)
  702.  
  703.    class Meta:
  704.        managed = False
  705.        gds_database = 'gds'
  706.        db_table = 'medias'
  707.  
  708.  
  709. class Migrations(GdsModel):
  710.    migration = models.CharField(max_length=255)
  711.    batch = models.IntegerField()
  712.  
  713.    class Meta:
  714.        managed = False
  715.        gds_database = 'gds'
  716.        db_table = 'migrations'
  717.  
  718.  
  719. class PasswordResets(GdsModel):
  720.    email = models.CharField(max_length=255)
  721.    token = models.CharField(max_length=255)
  722.    created_at = models.DateTimeField()
  723.  
  724.    class Meta:
  725.        managed = False
  726.        gds_database = 'gds'
  727.        db_table = 'password_resets'
  728.  
  729.  
  730. class Questions(GdsModel):  # CA
  731.    hashed_id = models.CharField(max_length=40)
  732.    question = models.TextField()
  733.    rnu = models.IntegerField()
  734.    answer = models.TextField()
  735.    active = models.IntegerField()
  736.    created_at = models.DateTimeField()
  737.    updated_at = models.DateTimeField(blank=True, null=True)
  738.    added_by = models.ForeignKey('Users', models.DO_NOTHING, db_column='added_by', blank=True,
  739.                                 null=True)
  740.    new_record_notification_sent = models.IntegerField()
  741.    deleted_at = models.DateTimeField(blank=True, null=True)
  742.  
  743.    def get_answer_link(self):
  744.        return '{}/answers?id={}'.format(GDS_URL, self.hashed_id)
  745.  
  746.    def __str__(self):
  747.        return '{}'.format(self.question)
  748.  
  749.    class Meta:
  750.        managed = False
  751.        gds_database = 'gds'
  752.        db_table = 'questions'
  753.  
  754.  
  755. class QuestionsLookup(GdsModel):
  756.    question = models.ForeignKey(Questions, models.DO_NOTHING)
  757.    fk_table = models.CharField(max_length=200)
  758.    fk_id = models.IntegerField()
  759.    created_at = models.DateTimeField()
  760.    updated_at = models.DateTimeField(blank=True, null=True)
  761.  
  762.    class Meta:
  763.        managed = False
  764.        gds_database = 'gds'
  765.        db_table = 'questions_lookup'
  766.  
  767.  
  768. class TransferPoliciesAirport(GdsModel):
  769.    cp = models.ForeignKey(Cp, models.DO_NOTHING)
  770.    airport_code = models.CharField(max_length=15)
  771.    min_price = models.CharField(max_length=100)
  772.    status = models.CharField(max_length=3)
  773.    restriction = models.CharField(max_length=255)
  774.  
  775.    class Meta:
  776.        managed = False
  777.        gds_database = 'gds'
  778.        db_table = 'transfer_policies_airport'
  779.  
  780.  
  781. class TransferPoliciesCp(GdsModel):
  782.    cp = models.ForeignKey(Cp, models.DO_NOTHING)
  783.    min_price = models.CharField(max_length=100)
  784.    status = models.CharField(max_length=3)
  785.    restriction = models.CharField(max_length=255)
  786.  
  787.    class Meta:
  788.        managed = False
  789.        gds_database = 'gds'
  790.        db_table = 'transfer_policies_cp'
  791.  
  792.  
  793. class Userroles(GdsModel):
  794.    role = models.CharField(max_length=50)
  795.    role_safe = models.CharField(max_length=50)
  796.    created_at = models.DateTimeField(blank=True, null=True)
  797.    updated_at = models.DateTimeField(blank=True, null=True)
  798.  
  799.    class Meta:
  800.        managed = False
  801.        gds_database = 'gds'
  802.        db_table = 'userroles'
  803.  
  804.  
  805. class Users(GdsModel):
  806.    role = models.ForeignKey(Userroles, models.DO_NOTHING, blank=True, null=True)
  807.    first_name = models.CharField(max_length=50)
  808.    last_name = models.CharField(max_length=50)
  809.    email = models.CharField(unique=True, max_length=255)
  810.    username = models.CharField(unique=True, max_length=100)
  811.    password = models.CharField(max_length=60)
  812.    active = models.IntegerField()
  813.    remember_token = models.CharField(max_length=100, blank=True, null=True)
  814.    created_at = models.DateTimeField()
  815.    updated_at = models.DateTimeField(blank=True, null=True)
  816.  
  817.    class Meta:
  818.        managed = False
  819.        gds_database = 'gds'
  820.        db_table = 'users'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement