-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Remove TripReport model and integrate into Trip model * Display trip reports on the trip page * Rename TripReportDetail to TripReportRedirect * Add trip report field to TripAdmin
- Loading branch information
Showing
35 changed files
with
218 additions
and
946 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.6 on 2023-10-20 09:29 | ||
|
||
import tinymce.models | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("logger", "0027_remove_tripreport_unique_slug_per_user_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="trip", | ||
name="trip_report", | ||
field=tinymce.models.HTMLField(blank=True), | ||
), | ||
] |
27 changes: 27 additions & 0 deletions
27
app/logger/migrations/0029_migrate_trip_report_content_to_trips.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 4.2.6 on 2023-10-20 09:34 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def migrate_trip_report_content_to_trips(apps, schema_editor): | ||
trip_report = apps.get_model("logger", "TripReport") | ||
trip = apps.get_model("logger", "Trip") | ||
|
||
for report in trip_report.objects.all(): | ||
trip.objects.filter(pk=report.trip.pk).update(trip_report=report.content) | ||
if report.privacy == "Friends": | ||
trip.objects.filter(pk=report.trip.pk).update(privacy="Friends") | ||
elif report.privacy == "Private": | ||
trip.objects.filter(pk=report.trip.pk).update(privacy="Private") | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("logger", "0028_trip_trip_report"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
migrate_trip_report_content_to_trips, reverse_code=migrations.RunPython.noop | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
app/logger/migrations/0030_alter_trip_notes_alter_trip_trip_report.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.2.6 on 2023-10-20 09:44 | ||
|
||
import tinymce.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("logger", "0029_migrate_trip_report_content_to_trips"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="trip", | ||
name="notes", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Trip notes should contain brief details of the trip, and may be private depending on your account settings. For full trip reports, use the trip report field below.", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="trip", | ||
name="trip_report", | ||
field=tinymce.models.HTMLField( | ||
blank=True, | ||
help_text="Trip reports are full, article style reports of a trip and will be visible to anyone who can view the trip.", | ||
), | ||
), | ||
] |
Oops, something went wrong.