Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LinkAhead Loan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
LinkAhead Loan
Commits
4abe3f46
Commit
4abe3f46
authored
2 months ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: create a real config file
parent
60ad4c36
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
MAINT: move datamodel config to a separate file
Pipeline
#60973
failed
2 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loanpy/src/loan/conf.py
+32
-21
32 additions, 21 deletions
loanpy/src/loan/conf.py
with
32 additions
and
21 deletions
loanpy/src/loan/conf.py
+
32
−
21
View file @
4abe3f46
import
linkahead
as
db
import
os
import
configparser
import
importlib.resources
as
pkg_resources
default_config_path
=
pkg_resources
.
path
(
__package__
,
'
default_config.ini
'
)
user_config_path
=
os
.
path
.
expanduser
(
'
~/.linkahead_loan
'
)
config
=
configparser
.
ConfigParser
()
config
.
read
([
default_config_path
,
user_config_path
])
rts
=
config
[
'
RecordTypes
'
]
ps
=
config
[
'
Properties
'
]
# RecordTypes
BOX
=
db
.
RecordType
(
name
=
"
Box
"
)
PERSON
=
db
.
RecordType
(
name
=
"
Person
"
)
LOAN
=
db
.
RecordType
(
name
=
"
Loan
"
)
BOX
=
db
.
RecordType
(
name
=
rts
[
'
BOX
'
])
PERSON
=
db
.
RecordType
(
name
=
rts
[
'
PERSON
'
])
LOAN
=
db
.
RecordType
(
name
=
rts
[
'
LOAN
'
])
# Properties
FIRST_NAME
=
db
.
Property
(
name
=
"
firstName
"
,
datatype
=
db
.
TEXT
)
LAST_NAME
=
db
.
Property
(
name
=
"
lastName
"
,
datatype
=
db
.
TEXT
)
EMAIL
=
db
.
Property
(
name
=
"
email
"
,
datatype
=
db
.
TEXT
)
LOCATION
=
db
.
RecordType
(
name
=
"
Location
"
)
DESTINATION
=
db
.
Property
(
name
=
"
LoanLocation
"
,
datatype
=
"
Location
"
)
RETURNLOCATION
=
db
.
Property
(
name
=
"
ReturnLocation
"
,
datatype
=
"
Location
"
)
COMMENT
=
db
.
Property
(
name
=
"
comment
"
,
datatype
=
db
.
TEXT
)
EXHAUST_CONTENTS
=
db
.
Property
(
name
=
"
exhaustContents
"
,
datatype
=
db
.
BOOLEAN
)
BORROWER
=
db
.
Property
(
name
=
"
Borrower
"
,
datatype
=
PERSON
.
name
)
CONTENT
=
db
.
Property
(
name
=
"
Content
"
,
datatype
=
db
.
TEXT
)
LOAN_REQUESTED
=
db
.
Property
(
name
=
"
loanRequested
"
,
datatype
=
db
.
DATETIME
)
EXPECTED_RETURN
=
db
.
Property
(
name
=
"
expectedReturn
"
,
datatype
=
db
.
DATETIME
)
LOAN_ACCEPTED
=
db
.
Property
(
name
=
"
loanAccepted
"
,
datatype
=
db
.
DATETIME
)
LENT
=
db
.
Property
(
name
=
"
lent
"
,
datatype
=
db
.
DATETIME
)
RETURN_REQUESTED
=
db
.
Property
(
name
=
"
returnRequested
"
,
datatype
=
db
.
DATETIME
)
RETURN_ACCEPTED
=
db
.
Property
(
name
=
"
returnAccepted
"
,
datatype
=
db
.
DATETIME
)
RETURNED
=
db
.
Property
(
name
=
"
returned
"
,
datatype
=
db
.
DATETIME
)
BOX_NUMBER
=
db
.
Property
(
name
=
"
Number
"
,
datatype
=
db
.
TEXT
)
FIRST_NAME
=
db
.
Property
(
name
=
ps
[
'
FIRST_NAME
'
]
,
datatype
=
db
.
TEXT
)
LAST_NAME
=
db
.
Property
(
name
=
ps
[
'
LAST_NAME
'
]
,
datatype
=
db
.
TEXT
)
EMAIL
=
db
.
Property
(
name
=
ps
[
'
EMAIL
'
]
,
datatype
=
db
.
TEXT
)
LOCATION
=
db
.
RecordType
(
name
=
rts
[
'
LOCATION
'
]
)
DESTINATION
=
db
.
Property
(
name
=
ps
[
'
DESTINATION
'
],
datatype
=
rts
[
'
LOCATION
'
]
)
RETURNLOCATION
=
db
.
Property
(
name
=
ps
[
'
RETURNLOCATION
'
],
datatype
=
rts
[
'
LOCATION
'
]
)
COMMENT
=
db
.
Property
(
name
=
ps
[
'
COMMENT
'
]
,
datatype
=
db
.
TEXT
)
EXHAUST_CONTENTS
=
db
.
Property
(
name
=
ps
[
'
EXHAUST_CONTENTS
'
]
,
datatype
=
db
.
BOOLEAN
)
BORROWER
=
db
.
Property
(
name
=
ps
[
'
BORROWER
'
]
,
datatype
=
rts
[
'
PERSON
'
]
)
CONTENT
=
db
.
Property
(
name
=
ps
[
'
CONTENT
'
]
,
datatype
=
db
.
TEXT
)
LOAN_REQUESTED
=
db
.
Property
(
name
=
ps
[
'
LOAN_REQUESTED
'
]
,
datatype
=
db
.
DATETIME
)
EXPECTED_RETURN
=
db
.
Property
(
name
=
ps
[
'
EXPECTED_RETURN
'
]
,
datatype
=
db
.
DATETIME
)
LOAN_ACCEPTED
=
db
.
Property
(
name
=
ps
[
'
LOAN_ACCEPTED
'
]
,
datatype
=
db
.
DATETIME
)
LENT
=
db
.
Property
(
name
=
ps
[
'
LENT
'
]
,
datatype
=
db
.
DATETIME
)
RETURN_REQUESTED
=
db
.
Property
(
name
=
ps
[
'
RETURN_REQUESTED
'
]
,
datatype
=
db
.
DATETIME
)
RETURN_ACCEPTED
=
db
.
Property
(
name
=
ps
[
'
RETURN_ACCEPTED
'
]
,
datatype
=
db
.
DATETIME
)
RETURNED
=
db
.
Property
(
name
=
ps
[
'
RETURNED
'
]
,
datatype
=
db
.
DATETIME
)
BOX_NUMBER
=
db
.
Property
(
name
=
ps
[
'
BOX_NUMBER
'
]
,
datatype
=
db
.
TEXT
)
# Other Strings
# TODO: Adapt datamodel and remove name override
...
...
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