コード例 #1
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #2
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 def save(self, session):
     entry = ref.Entry(entry_types_id=self.entry_types_id,
                       author=self.author,
                       title=self.title,
                       howpublished=self.howpublished,
                       month=self.month,
                       year=self.year,
                       note=self.note)
     session.add(entry)
コード例 #3
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #4
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #5
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #6
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #7
0
ファイル: views.py プロジェクト: suhitaghosh10/oeplatform
 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}, )
コード例 #8
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #9
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #10
0
ファイル: views.py プロジェクト: suhitaghosh10/oeplatform
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)
        sess.add(en)
    sess.commit()
    sess.close()
    return redirect('/literature')
コード例 #11
0
ファイル: forms.py プロジェクト: suhitaghosh10/oeplatform
 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)
コード例 #12
0
ファイル: views.py プロジェクト: sashatankov/oeplatform
 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,
         },
     )