forked from mmmaly/chcemvediet
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactorovat mazanie instancii #334
Labels
Comments
This was referenced Dec 18, 2020
viliambalaz
added a commit
that referenced
this issue
Mar 4, 2021
viliambalaz
added a commit
that referenced
this issue
Mar 27, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 9, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 13, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 13, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 13, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 15, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 15, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 15, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 15, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 16, 2021
* #334 Refactor Action admin deleting * #334 Move delete_dependency to admin and review suggestions * #334 Use set_attributes tag to disable submit button * #334 Review Co-authored-by: Martin Macko <[email protected]>
viliambalaz
added a commit
that referenced
this issue
Apr 16, 2021
viliambalaz
added a commit
that referenced
this issue
Apr 27, 2021
viliambalaz
added a commit
that referenced
this issue
May 7, 2021
viliambalaz
added a commit
that referenced
this issue
May 10, 2021
viliambalaz
added a commit
that referenced
this issue
May 10, 2021
viliambalaz
added a commit
that referenced
this issue
May 23, 2021
viliambalaz
added a commit
that referenced
this issue
Jun 3, 2021
viliambalaz
added a commit
that referenced
this issue
Jun 3, 2021
viliambalaz
added a commit
that referenced
this issue
Jun 25, 2021
viliambalaz
added a commit
that referenced
this issue
Jun 26, 2021
* #334 Allow admin bulk delete on Action model * #334 Various refactoring * #334 Snooze previous actions * #334 Refactor methods for snooze * #334 Unify delete_confirmation and delete_selected_confirmation templates * #394 Change inforequestemails queryset * #334 Send queryset as parameter to delete_constraints and delete_warning methods
viliambalaz
added a commit
that referenced
this issue
Jun 27, 2021
viliambalaz
added a commit
that referenced
this issue
Jun 29, 2021
viliambalaz
added a commit
that referenced
this issue
Jul 11, 2021
viliambalaz
added a commit
that referenced
this issue
Jul 25, 2021
martinmacko47
pushed a commit
that referenced
this issue
Jul 29, 2021
viliambalaz
added a commit
that referenced
this issue
Aug 24, 2021
viliambalaz
added a commit
that referenced
this issue
Dec 7, 2021
viliambalaz
added a commit
that referenced
this issue
Jan 9, 2022
viliambalaz
added a commit
that referenced
this issue
Jan 12, 2022
martinmacko47
added a commit
that referenced
this issue
Apr 2, 2022
martinmacko47
added a commit
that referenced
this issue
Apr 3, 2022
martinmacko47
added a commit
that referenced
this issue
Apr 11, 2022
viliambalaz
pushed a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 12, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 20, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 20, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 20, 2022
viliambalaz
added a commit
that referenced
this issue
Apr 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logiku mazania instancii v admin rozhrani sme mali rozhadzanu po vela taskoch, v ktorych mame chos. Spojil som ich tu do jedneho tasku, nech v tom mame poriadok a lepsie sa trackuje, co uz je spravene a co nie. Taktiez teraz, ked mame
{% amend %}
template tag, zrejme kopec veci pojde spravit elegantnejsie.Jednotlive veci rob postupne v samostatnych PR. Kludne aj viac PR na jeden checkbox. Checkbox sa zaskrtne, ked bude dany bod hotovy cely.
Najprv zober niektory vzorovy model a vyskusaj na nom, ako vieme mazanie implementovat. Potom to rovnakym sposobom implementujeme pre zvysne modely:
{% amend %}
template tagu alebo inou upravou templatu presunut von zo zoznamu rekurzivne mazanych instancii, do separatneho odstavca. Nech zbytocne nezneuzivamecontext[u'deleted_objects']
na ine veci. Vid obrazok:Ak ano:
context[u'deleted_objects']
na nieco ine, nez je urcene a tiez to presun do samostatnych odstavcov.{% amend %}
template tagu alebo inou upravou templatu vieme nejak elegantne spravit mazanie jednej instancie tak, ze ak sa instancia z nejakeho dovodu nema dat zmazat, tak na obrazovke, kde sa mazanie potvrzuje, sa zobrazi dovod, preco sa instancia zmazat neda, a button na potvrdenie zmazania tam nezobrazit.{% amend %}
template tagu uz vieme nejak elegantne spravit hromadne mazanie oznacenych instancii, s tym, ze ak niektoru z oznacenych instancii z nejakeho dovodu nebude mozne zmazat, tak na obrazovke, kde sa mazanie potvrzuje, sa zobrazi dovod, preco sa instancia zmazat neda, a button na potvrdenie zmazania tam nezobrazit. Ak sa to teraz uz da, tak vsetkym modelom hromadne mazanie povolime. Inac vsetkym modelom hromadne mazanie zakazeme.Podmienky pre jednotlive modely, kedy sa maju dat zmazat:
Action
: Ostavaju rovnake, ako uz mame iplementovane, len samotne mazanie treba prerobit ako je popisane vyssie:REQUEST
aniADVANCED_REQUEST
EXPIRATION
aleboAPPEAL_EXPIRATION
, tak sa zobrazi checkbox sa predlzenie snooze predoslej akcieInforequestEmail
instancii, ktore sa zmazu resp. oznacia za undecidedBranch
: Ostavaju rovnake, ako uz mame iplementovane, len samotne mazanie treba prerobit ako je popisane vyssie:InforequestEmail
instancii, ktore sa zmazu resp. oznacia za undecidedInforequestEmail
:InforequestEmail
odkazujuci na emailMessage
, ktory je pouzity v niektorejAction
prislusnej ziadosti. Teda, ze vzdy musi byt splneny invariant, ze vsetky Message pouzite v akciach infoziadosti, musia byt nalinkovane na infoziadost aj cezInforequestEmail
.Inforequest
:Inforequest
, tak sa zmazu vsetky veci, co s nim suvisia, ale samotne maily, teda instancieMessage
, ktore pre tuto ziadost vznikli, sa nezmazu. Zmena sa iba ich priradenie ziadosti cezInforequestEmail
.InforequestDraft
:WizardDraft
Message
/Recipient
/Attachment
:Message
aniAttachment
, na ktory je od niekial FK, okrem zAttachment
aRecepient
. Ak bude admin chciet zmazatMessage
aleboAttachment
, bude musiet najprv porusit FK nan. Aby zmazanimMessage
resp.Attachment
sa nezmazalo nieco, co nechceme.Message
tak sa s nim automaticky zmazu vsetky jehoAttachment
aRecepient
.Recepient
nema vlastny admin, je iba ako inline v ramciMessage
. Takze jeho mazanie funguje inac.Attachment
aRecepient
. Pripadne skusit, ci to nejde spravit nejak automaticky pomocouForeignKey.on_delete
.ObligeeTag
/ObligeeGroup
/Obligee
/HistoricalObligee
/ObligeeAlias
:Region
/District
/Municipality
/Neighbourhood
:Profile
/InvitationSupply
Profile
a jedna instanciaInvitationSupply
, tak sa nesmu mazat samostatne. Zmazu sa iba, ked sa zmaze cely user.Invitation
AttachmentNormalization
/AttachmentRecognition
/AttachmentAnonymization
/AttachmentFinalization
:AttachmentNormalization
, tak sa automaticky zmaze ajAttachmentRecognition
a ostatne pre ten isty attachmentAttachmentRecognition
, tak sa automaticky zmaze ajAttachmentAnonymization
aAttachmentFinalization
pre ten isty attachmentAttachmentAnonymization
, tak sa automaticky zmaze ajAttachmentFinalization
Mazanie modelov z externych kniznic. Najprv treba zistit, ci vobec vieme nejako upravid admin pre modely z externych kniznit. A ak ano, tak potom:
Nakoniec:
The text was updated successfully, but these errors were encountered: