junkhp / esuits_junki Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
ワードクラウド作成に時間がかかる(これは割と仕方ない)
そのため、作成→編集のとき、下記の仕様のはず
なのに下記の処理手順になっているっぽいなっているっぽい
inlineformset_factory
を使用してformsetを作成formset
AnswerUpdateFormSet = forms.modelformset_factory(
model=AnswerModel,
fields=(answer,),
extra=0
)
view.py
formsets = AnswerUpdateFormSet(queryset=更新するQuerySet)
extra=0
queryset=Model.objects.all()
なのでAnswerModel
を全選択してしまう回答モデルをORMで一発で絞り込む方法がわからない
SELECT *
FROM answers
JOIN questions
ON answers.question_id = questions.id
WHERE
question_id in questions
AND answers.version = questions.selected_version
Djangoのデフォルトは、オートコミット(save()やdelete()をしたタイミングでデータベースが変更される)
True
にする。トランザクションを整備する
escreate/views.py
の98行目
question_form.save()
のあとに保存された質問レコードに紐づく回答レコードを新規作成
new_answer_record = AnswerModel(question=question_record)
new_answer_record.save()
question_record = question_form.save()
では、question_recordが取得できない
フロント側で文字数を計算し画面に出力する
1つのURLに対して紐づく企業は1つなので、2社
回答内容に編集を加えたときにその変更を新しい回答として保存できるようにしたい
簡単なところからトライする
Process running mem=802M(156.8%)
esedit/views.py
でワードクラウドを作成するためのURLを取得するときに会社名で検索をかけており、1つの企業に複数のURLが紐付いているときにURLが一意に決まらない
company_url_info = CompanyHomepageURLModel.objects.get(company=es_info.company)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.