Beispiel #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)
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())