Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
transporte
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Logistik
transporte
Commits
ab49511b
Unverified
Commit
ab49511b
authored
2 years ago
by
hanfi
Browse files
Options
Downloads
Patches
Plain Diff
code styled
parent
058b76d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+7
-0
7 additions, 0 deletions
README.md
create_testentrys.py
+69
-41
69 additions, 41 deletions
create_testentrys.py
setup.py
+4
-4
4 additions, 4 deletions
setup.py
with
80 additions
and
45 deletions
README.md
+
7
−
0
View file @
ab49511b
...
...
@@ -60,3 +60,10 @@ Install development tools
pip install -r requirements-dev.txt
pre-commit install
```
please use black,isort and flake8 to ensure coherent code style
```
black transporte
isort --profile black transporte
flake8 transporte
```
This diff is collapsed.
Click to expand it.
create_testentrys.py
+
69
−
41
View file @
ab49511b
from
transporte
import
transporte
from
transporte.models
import
*
from
datetime
import
date
,
time
,
timedelta
from
random
import
randint
,
choice
import
string
from
datetime
import
date
,
time
,
timedelta
from
random
import
choice
,
randint
from
transporte.models
import
Transport
,
User
,
db
roles
=
[
'
helpdesk
'
,
'
user
'
]
roles
=
[
"
helpdesk
"
,
"
user
"
]
user
=
User
.
query
.
filter
(
User
.
login
==
'
test@psy.rocks
'
).
first
()
user
=
User
.
query
.
filter
(
User
.
login
==
"
test@psy.rocks
"
).
first
()
if
user
is
None
:
user
=
User
(
login
=
'
test@psy.rocks
'
,
role
=
'
admin
'
)
user
=
User
(
login
=
"
test@psy.rocks
"
,
role
=
"
admin
"
)
db
.
session
.
add
(
user
)
db
.
session
.
commit
()
...
...
@@ -16,47 +16,75 @@ users = User.query.all()
while
len
(
users
)
<
4
:
user
=
User
(
login
=
'
{}@test.psy.rocks
'
.
format
(
''
.
join
([
choice
(
string
.
ascii_lowercase
)
for
_
in
range
(
5
)]),
role
=
'
admin
'
))
login
=
"
{}@test.psy.rocks
"
.
format
(
""
.
join
([
choice
(
string
.
ascii_lowercase
)
for
_
in
range
(
5
)])
),
role
=
"
admin
"
,
)
db
.
session
.
add
(
user
)
db
.
session
.
commit
()
users
.
append
(
user
)
organizers
=
[
'
CCCV
'
,
'
NOC
'
,
'
BOC
'
,
'
foobar
'
]
addresses
=
[
'
CCCV GmbH (Lager Berlin)
\n
Holzhauser Straße 139
\n
13509 Berlin
'
,
'
Messe Leipzig
\n
Halle 4
'
,
'
CCCV GmbH (Lager Leipzig)
\n
Diezmannstraße 20
\n
04207 Leipzig
'
,
'
Getränkelieferant Hamburg
'
]
vehicles
=
[
'
car
'
,
'
trailer
'
,
'
transporter
'
,
'
7.5t
'
,
'
18t
'
,
'
40t
'
]
owner
=
[
'
Spedition XYZ
'
,
'
CCCV
'
,
'
Sixt
'
,
'
private
'
]
persons
=
[
'
Fahrer XYZ, 0123456789
'
,
'
cpunkt, kennste
'
,
'
LOC
'
,
'
Nick Fahrer
'
]
goods
=
[
'
Congress is coming, LOC Crew needs to be shipped! Defrosting initialized! Cryo capsules in wake up mode.
'
,
'
Beverages
'
,
'
Popcorn
'
,
'
Merch
'
,
'
Everything!
'
,
'
* Gitterboxen
\r\n
* Bauzaun
\r\n
* lauter brandschutzrelevanter Kram
'
]
comments
=
[
'
What a greate comment!
\n
Multiline!
\n
Great line!
\n\n
Great!
'
,
'
Whoooohooo
'
,
'
Yipp yipp yipp
'
,
'
<script>alert(1);</script>
'
]
organizers
=
[
"
CCCV
"
,
"
NOC
"
,
"
BOC
"
,
"
foobar
"
]
addresses
=
[
"
CCCV GmbH (Lager Berlin)
\n
Holzhauser Straße 139
\n
13509 Berlin
"
,
"
Messe Leipzig
\n
Halle 4
"
,
"
CCCV GmbH (Lager Leipzig)
\n
Diezmannstraße 20
\n
04207 Leipzig
"
,
"
Getränkelieferant Hamburg
"
,
]
vehicles
=
[
"
car
"
,
"
trailer
"
,
"
transporter
"
,
"
7.5t
"
,
"
18t
"
,
"
40t
"
]
owner
=
[
"
Spedition XYZ
"
,
"
CCCV
"
,
"
Sixt
"
,
"
private
"
]
persons
=
[
"
Fahrer XYZ, 0123456789
"
,
"
cpunkt, kennste
"
,
"
LOC
"
,
"
Nick Fahrer
"
]
goods
=
[
"""
Congress is coming, LOC Crew needs to be shipped!
Defrosting initialized! Cryo capsules in wake up mode.
"""
"
Beverages
"
,
"
Popcorn
"
,
"
Merch
"
,
"
Everything!
"
,
"
* Gitterboxen
\r\n
* Bauzaun
\r\n
* lauter brandschutzrelevanter Kram
"
,
]
comments
=
[
"
What a greate comment!
\n
Multiline!
\n
Great line!
\n\n
Great!
"
,
"
Whoooohooo
"
,
"
Yipp yipp yipp
"
,
"
<script>alert(1);</script>
"
,
]
for
i
in
range
(
0
,
2
):
foo
=
Transport
(
user_id
=
choice
(
users
).
id
,
organizer
=
choice
(
organizers
),
needs_organization
=
randint
(
0
,
1
),
foo
=
Transport
(
user_id
=
choice
(
users
).
id
,
organizer
=
choice
(
organizers
),
needs_organization
=
randint
(
0
,
1
),
origin
=
choice
(
addresses
),
destination
=
choice
(
addresses
),
date
=
date
.
today
()
-
timedelta
(
days
=
i
),
time
=
time
(
hour
=
randint
(
0
,
23
),
minute
=
randint
(
0
,
59
)),
vehicle
=
choice
(
vehicles
),
time
=
time
(
hour
=
randint
(
0
,
23
),
minute
=
randint
(
0
,
59
)),
vehicle
=
choice
(
vehicles
),
goods
=
choice
(
goods
),
vehicle_owner
=
choice
(
owner
),
driver_contact
=
choice
(
persons
),
orga_contact
=
choice
(
persons
),
comment
=
choice
(
comments
))
driver_contact
=
choice
(
persons
),
orga_contact
=
choice
(
persons
),
comment
=
choice
(
comments
),
)
db
.
session
.
add
(
foo
)
db
.
session
.
commit
()
for
_
in
range
(
10
):
foo
=
Transport
(
user_id
=
choice
(
users
).
id
,
organizer
=
choice
(
organizers
),
needs_organization
=
randint
(
0
,
1
),
foo
=
Transport
(
user_id
=
choice
(
users
).
id
,
organizer
=
choice
(
organizers
),
needs_organization
=
randint
(
0
,
1
),
origin
=
choice
(
addresses
),
destination
=
choice
(
addresses
),
date
=
date
.
today
()
+
timedelta
(
days
=
randint
(
0
,
31
)),
time
=
time
(
hour
=
randint
(
0
,
23
),
minute
=
randint
(
0
,
59
)),
vehicle
=
choice
(
vehicles
),
time
=
time
(
hour
=
randint
(
0
,
23
),
minute
=
randint
(
0
,
59
)),
vehicle
=
choice
(
vehicles
),
goods
=
choice
(
goods
),
vehicle_owner
=
choice
(
owner
),
driver_contact
=
choice
(
persons
),
orga_contact
=
choice
(
persons
),
comment
=
choice
(
comments
))
driver_contact
=
choice
(
persons
),
orga_contact
=
choice
(
persons
),
comment
=
choice
(
comments
),
)
db
.
session
.
add
(
foo
)
db
.
session
.
commit
()
This diff is collapsed.
Click to expand it.
setup.py
+
4
−
4
View file @
ab49511b
from
setuptools
import
setup
setup
(
name
=
'
transporte
'
,
packages
=
[
'
transporte
'
],
name
=
"
transporte
"
,
packages
=
[
"
transporte
"
],
include_package_data
=
True
,
install_requires
=
[
'
flask
'
,
"
flask
"
,
],
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment