collective / collective/rapido.core
get_record should take a default like get
- Dominant language
- Python
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Would make some code easier. For example
```
record = context.app.get_record(path)
if record is None:
total = 0
else:
total = record.get('total', 0)
return "votes is %s" % str(total)
```
becomes
```
return "votes is %s" % str( context.app.get_record(path, {}).get('total', 0))
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the get_record and get implementations and inspect how their arguments and missing values are handled. Add support for an optional default to get_record while preserving its current behavior when no default is supplied, then run the repository's existing tests if available to verify both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100