Ejemplo n.º 1
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        dbsession = DBSession()
        redbook_species_db = dbsession.query(RedBook, RedBookSpecies, Taxon)\
            .join(RedBookSpecies, RedBook.id == RedBookSpecies.red_book_id)\
            .join(Taxon, RedBookSpecies.specie_id == Taxon.id)\
            .order_by(RedBook.id, RedBookSpecies.specie_id)\
            .all()
        dbsession.close()

        attribute_names = ['region', 'orig_name', 'lat_name', 'author', 'population', 'status', 'univ_status', 'year',
                           'bibl']

        objects_for_dump = [
            [
                o[1].region,
                o[1].orig_name,
                o[2].name,
                o[1].author,
                o[1].population,
                o[1].status,
                o[1].univ_status,
                o[1].year,
                o[0].name
            ] for o in redbook_species_db
        ]

        dump(filename, attribute_names, objects_for_dump, is_array=True)
Ejemplo n.º 2
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'doc_type_id', 'filename', 'fullname',
             'author', 'magazine', 'pages', 'mammals', 'birds',
             'reptiles', 'amphibians', 'fish', 'invertebrates', 'vascular',
             'bryophytes', 'lichens', 'fungi', 'maps']
     dump(filename, fieldnames, DBSession().query(Inforesources).order_by(Inforesources.id).all())
Ejemplo n.º 3
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        fieldnames = [
            'id', 'parent_id', 'old_id', 'taxon_type', 'name', 'russian_name',
            'author', 'source'
        ]
        dump(filename, fieldnames,
             DBSession().query(Taxon).order_by(Taxon.id).all())
Ejemplo n.º 4
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = [
         'id', 'name', 'fullname', 'speciality', 'degree', 'organization',
         'position', 'email', 'phone', 'address'
     ]
     dbsession = DBSession()
     dump(filename, fieldnames,
          dbsession.query(Person).order_by(Person.id).all())
Ejemplo n.º 5
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = [
         'id', 'doc_type_id', 'filename', 'fullname', 'author', 'magazine',
         'pages', 'mammals', 'birds', 'reptiles', 'amphibians', 'fish',
         'invertebrates', 'vascular', 'bryophytes', 'lichens', 'fungi',
         'maps'
     ]
     dump(filename, fieldnames,
          DBSession().query(Inforesources).order_by(Inforesources.id).all())
Ejemplo n.º 6
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump
        fieldnames = ['square_id', 'key_area_id']

        squares_from_db = DBSession().query(Squares).join(Squares.key_areas).order_by(Squares.id).all()

        squares = []
        for square in squares_from_db:
            for key_area in square.key_areas:
                squares.append([square.id, key_area.id])

        dump(filename, fieldnames, squares, is_array=True)
Ejemplo n.º 7
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump
        fieldnames = ['square_id', 'key_area_id']

        squares_from_db = DBSession().query(Squares).join(
            Squares.key_areas).order_by(Squares.id).all()

        squares = []
        for square in squares_from_db:
            for key_area in square.key_areas:
                squares.append([square.id, key_area.id])

        dump(filename, fieldnames, squares, is_array=True)
Ejemplo n.º 8
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        dbsession = DBSession()
        redbook_species_db = dbsession.query(RedBook, RedBookSpecies, Taxon)\
            .join(RedBookSpecies, RedBook.id == RedBookSpecies.red_book_id)\
            .join(Taxon, RedBookSpecies.specie_id == Taxon.id)\
            .order_by(RedBook.id, RedBookSpecies.specie_id)\
            .all()
        dbsession.close()

        attribute_names = [
            'region', 'orig_name', 'lat_name', 'author', 'population',
            'status', 'univ_status', 'year', 'bibl'
        ]

        objects_for_dump = [[
            o[1].region, o[1].orig_name, o[2].name, o[1].author,
            o[1].population, o[1].status, o[1].univ_status, o[1].year,
            o[0].name
        ] for o in redbook_species_db]

        dump(filename, attribute_names, objects_for_dump, is_array=True)
Ejemplo n.º 9
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'footprint', 'org_type', 'description']
     dump(filename, fieldnames,
          DBSession().query(Footprint).order_by(Footprint.id).all())
Ejemplo n.º 10
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'abundance']
     dump(filename, fieldnames,
          DBSession().query(Abundance).order_by(Abundance.id).all())
Ejemplo n.º 11
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'abundance']
     dump(filename, fieldnames, DBSession().query(Abundance).order_by(Abundance.id).all())
Ejemplo n.º 12
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'login', 'password', 'person_id', 'role']
     dump(filename, fieldnames, DBSession().query(User).order_by(User.id).all())
Ejemplo n.º 13
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        fieldnames = ["id", "parent_id", "old_id", "taxon_type", "name", "russian_name", "author", "source"]
        dump(filename, fieldnames, DBSession().query(Taxon).order_by(Taxon.id).all())
Ejemplo n.º 14
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'area_type', 'legend', 'name']
     dump(filename, fieldnames,
          DBSession().query(Key_area).order_by(Key_area.id).all())
Ejemplo n.º 15
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'taxa_scheme']
     dump(filename, fieldnames, DBSession().query(Taxa_scheme).order_by(Taxa_scheme.id).all())
Ejemplo n.º 16
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'area_type', 'legend', 'name']
     dump(filename, fieldnames, DBSession().query(Key_area).order_by(Key_area.id).all())
Ejemplo n.º 17
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'precision', 'count', 'description']
     dump(filename, fieldnames, DBSession().query(Legend).order_by(Legend.id).all())
Ejemplo n.º 18
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'anthr_press', 'description']
     dump(filename, fieldnames, DBSession().query(Anthr_press).order_by(Anthr_press.id).all())
Ejemplo n.º 19
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'doc_type']
     dump(filename, fieldnames, DBSession().query(Doc_type).all())
Ejemplo n.º 20
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'pheno', 'description', 'org_type']
     dump(filename, fieldnames, DBSession().query(Pheno).order_by(Pheno.id).all())
Ejemplo n.º 21
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'footprint', 'org_type', 'description']
     dump(filename, fieldnames, DBSession().query(Footprint).order_by(Footprint.id).all())
Ejemplo n.º 22
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'pheno', 'description', 'org_type']
     dump(filename, fieldnames,
          DBSession().query(Pheno).order_by(Pheno.id).all())
Ejemplo n.º 23
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'doc_type']
     dump(filename, fieldnames, DBSession().query(Doc_type).all())
Ejemplo n.º 24
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'name', 'fullname', 'speciality', 'degree', 'organization', 'position', 'email', 'phone',
                   'address']
     dbsession = DBSession()
     dump(filename, fieldnames, dbsession.query(Person).order_by(Person.id).all())
Ejemplo n.º 25
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'precision', 'count', 'description']
     dump(filename, fieldnames,
          DBSession().query(Legend).order_by(Legend.id).all())
Ejemplo n.º 26
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'museum']
     dump(filename, fieldnames, DBSession().query(Museum).order_by(Museum.id).all())
Ejemplo n.º 27
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        fieldnames = ["id", "species_id", "synonym", "author", "source"]
        dump(filename, fieldnames, DBSession().query(Synonym).order_by(Synonym.id).all())
Ejemplo n.º 28
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'login', 'password', 'person_id', 'role']
     dump(filename, fieldnames,
          DBSession().query(User).order_by(User.id).all())
Ejemplo n.º 29
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'anthr_press', 'description']
     dump(filename, fieldnames,
          DBSession().query(Anthr_press).order_by(Anthr_press.id).all())
Ejemplo n.º 30
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'vitality', 'org_type', 'description']
     dump(filename, fieldnames,
          DBSession().query(Vitality).order_by(Vitality.id).all())
Ejemplo n.º 31
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'taxa_scheme']
     dump(filename, fieldnames,
          DBSession().query(Taxa_scheme).order_by(Taxa_scheme.id).all())
Ejemplo n.º 32
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'vitality', 'org_type', 'description']
     dump(filename, fieldnames, DBSession().query(Vitality).order_by(Vitality.id).all())
Ejemplo n.º 33
0
    def export_to_file(filename):
        from nextgisbio.utils.dump_to_file import dump

        fieldnames = ['id', 'species_id', 'synonym', 'author', 'source']
        dump(filename, fieldnames,
             DBSession().query(Synonym).order_by(Synonym.id).all())
Ejemplo n.º 34
0
 def export_to_file(filename):
     from nextgisbio.utils.dump_to_file import dump
     fieldnames = ['id', 'museum']
     dump(filename, fieldnames,
          DBSession().query(Museum).order_by(Museum.id).all())