Beispiel #1
0
 def save(self, session):
     entry = ref.Entry(author=self.author, title=self.title,
                       institution=self.institution, year=self.year,
                       entry_types_id=self.entry_types_id, type=self.type,
                       note=self.note, number=self.number,
                       address=self.address, month=self.month)
     session.add(entry)
Beispiel #2
0
 def save(self, session):
     entry = ref.Entry(author=self.author, title=self.title,
                       school=self.school, year=self.year,
                       entry_types_id=self.entry_types_id, type=self.type,
                       address=self.address, month=self.month,
                       note=self.note)
     session.add(entry)
Beispiel #3
0
 def save(self, session):
     entry = ref.Entry(address=self.address, title=self.title,
                       year=self.year, entry_types_id=self.entry_types_id,
                       author=self.author, organization=self.organization,
                       edition=self.edition, month=self.month,
                       note=self.note)
     session.add(entry)
Beispiel #4
0
 def save(self, session):
     entry = ref.Entry(author=self.author, title=self.title,
                       journal=self.journal, year=self.year,
                       entry_types_id=self.entry_types_id,
                       volume=self.volume, number=self.number,
                       pages=self.pages, month=self.month, note=self.note)
     session.add(entry)
Beispiel #5
0
 def save(self, session):
     entry = ref.Entry(title=self.title, publisher=self.publisher,
                       year=self.year, entry_types_id=self.entry_types_id,
                       author=self.author, editor=self.editor,
                       series=self.series, address=self.address,
                       edition=self.edition, month=self.month,
                       note=self.note, isbn=self.isbn, volume=self.volume,
                       number=self.number)
     session.add(entry)
Beispiel #6
0
 def save(self, session):
     entry = ref.Entry(title=self.title, year=self.year,
                       entry_types_id=self.entry_types_id,
                       editor=self.editor, series=self.series,
                       address=self.address, month=self.month,
                       organization=self.organization,
                       publisher=self.publisher, note=self.note,
                       volume=self.volume, number=self.number)
     session.add(entry)
Beispiel #7
0
 def save(self, session):
     entry = ref.Entry(author=self.author, title=self.title,
                       booktitle=self.booktitle, publisher=self.publisher,
                       year=self.year, entry_types_id=self.entry_types_id,
                       editor=self.editor, series=self.series,
                       type=self.type, chapter=self.chapter,
                       pages=self.pages, address=self.address,
                       edition=self.edition, month=self.month,
                       note=self.note, volume=self.volume,
                       number=self.number)
     session.add(entry)
Beispiel #8
0
 def get(self, request, entries_id=None):
     if entries_id:
         engine = _get_engine()
         sess = Session(bind=engine)
         entry = sess.query(
             ref.Entry).filter(ref.Entry.entries_id == entries_id).first()
         btype = entry.entry_types.label if entry.entry_types else 'article'
     else:
         entry = ref.Entry()
         btype = None
     return render(
         request,
         'literature/reference_form.html',
         {
             'entry': entry,
             'years': range(datetime.datetime.now().year, 1899, -1),
             'id': entries_id,
             'btype': btype
         },
     )
Beispiel #9
0
def read_bibtexfile(bibtex_file):
    engine = _get_engine()
    metadata = MetaData()
    metadata.create_all(bind=engine)
    sess = Session(bind=engine)

    bibtex_database = btp.load(bibtex_file)
    for ent in bibtex_database.entries:
        props = {
            k.name: ent[k.name.replace('entries.', '')]
            for k in ref.Entry.__table__.c
            if k.name.replace('entries.', '') in ent
        }
        props['entry_types_id'] = get_bibtype_id(ent['ENTRYTYPE'])

        en = ref.Entry(**props)
        print(en.entry_types_id.label)
        sess.add(en)
    sess.commit()
    sess.close()
    return redirect('/literature')
Beispiel #10
0
 def save(self, session):
     entry = ref.Entry(title=self.title, entry_types_id=self.entry_types_id,
                       author=self.author, howpublished=self.howpublished,
                       address=self.address, month=self.month,
                       year=self.year, note=self.note)
     session.add(entry)
Beispiel #11
0
 def save(self, session):
     entry = ref.Entry(author=self.author, title=self.title, note=self.note,
                       entry_types_id=self.entry_types_id, month=self.month,
                       year=self.year)
     session.add(entry)