-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampleDbContent.py
More file actions
44 lines (37 loc) · 1.14 KB
/
exampleDbContent.py
File metadata and controls
44 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from Intectainment import db
from Intectainment.datamodels import Channel, Category
user = User.query.one()
for channelConfig in [
("Intectainment", "Intectainment ist ein Infotainmentsystem"),
("SRZ-III", "Algorithmierung"),
("SRZ-IV", "Was weiß denn ich"),
]:
channel = Channel(name=channelConfig[0], description=channelConfig[1])
channel.owner = user
db.session.add(channel)
intectainment = Channel.query.filter_by(name="Intectainment").first()
[
Post.new(intectainment.id, content, user)
for content in [
f"# Post {i}\n\nEs war einmal vor langer, langer Zeit" for i in range(0, 100)
]
]
for i in range(100):
channel = Channel(
name=f"Kanal{i}",
description="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
)
channel.owner = user
db.session.add(channel)
for category in [
"Python",
"Flask",
"Java",
"Infotainment",
"Informationsübertragung",
"CSS",
"JavaScript",
"Markdown",
]:
db.session.add(Category(name=category))
db.session.commit()