Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Netguru
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Piotr Maślanka
Netguru
Commits
a99c93af
Commit
a99c93af
authored
3 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fixed deletions, added admin panel for counting history
parent
fa6770b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#52548
failed with stages
in 2 minutes and 1 second
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
counting/admin.py
+10
-1
10 additions, 1 deletion
counting/admin.py
counting/migrations/0001_initial.py
+2
-3
2 additions, 3 deletions
counting/migrations/0001_initial.py
shares/admin.py
+7
-0
7 additions, 0 deletions
shares/admin.py
with
19 additions
and
4 deletions
counting/admin.py
+
10
−
1
View file @
a99c93af
from
django.contrib
import
admin
# Register your models here.
from
.models
import
StoryOfADay
@admin.register
(
StoryOfADay
)
class
StoryOfADayAdmin
(
admin
.
ModelAdmin
):
readonly_fields
=
'
day
'
,
'
links_visited
'
,
'
files_visited
'
def
has_add_permission
(
self
,
request
):
return
False
This diff is collapsed.
Click to expand it.
counting/migrations/0001_initial.py
+
2
−
3
View file @
a99c93af
# Generated by Django 3.2.6 on 2021-08-26 1
4:26
# Generated by Django 3.2.6 on 2021-08-26 1
5:50
from
django.db
import
migrations
,
models
...
...
@@ -14,8 +14,7 @@ class Migration(migrations.Migration):
migrations
.
CreateModel
(
name
=
'
StoryOfADay
'
,
fields
=
[
(
'
id
'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
day
'
,
models
.
DateField
(
verbose_name
=
'
Date
'
)),
(
'
day
'
,
models
.
DateField
(
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
Date
'
)),
(
'
links_visited
'
,
models
.
IntegerField
(
verbose_name
=
'
Links visited
'
)),
(
'
files_visited
'
,
models
.
IntegerField
(
verbose_name
=
'
Files visited
'
)),
],
...
...
This diff is collapsed.
Click to expand it.
shares/admin.py
+
7
−
0
View file @
a99c93af
...
...
@@ -25,5 +25,12 @@ class ShareForm(forms.ModelForm):
class
ShareAdmin
(
admin
.
ModelAdmin
):
form
=
ShareForm
readonly_fields
=
'
share_type
'
,
list_select_related
=
'
creator
'
,
def
has_add_permission
(
self
,
request
):
return
False
def
delete_queryset
(
self
,
request
,
queryset
):
"""
We need to unlink files
"""
for
share
in
queryset
:
share
.
delete
()
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