-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from volunteers-for-city-projects/fix/is_favo…
…rite_project Fixed adding a project to favorites and is_favorite in ProjectGetSeri…
- Loading branch information
Showing
5 changed files
with
137 additions
and
45 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
43 changes: 43 additions & 0 deletions
43
backend/projects/migrations/0005_projectfavorite_alter_volunteer_date_of_birth_and_more.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,43 @@ | ||
# Generated by Django 4.2.6 on 2023-11-19 21:04 | ||
|
||
import datetime | ||
from django.conf import settings | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('projects', '0004_alter_projectincomes_cover_letter'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProjectFavorite', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.project', verbose_name='Проект')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')), | ||
], | ||
options={ | ||
'verbose_name': 'Избранный проект', | ||
'verbose_name_plural': 'Избранные проекты', | ||
'default_related_name': 'project_favorite', | ||
}, | ||
), | ||
migrations.AlterField( | ||
model_name='volunteer', | ||
name='date_of_birth', | ||
field=models.DateField(help_text='Введите дату в формате "ГГГГ-ММ-ДД", пример: "2000-01-01".', validators=[django.core.validators.MinValueValidator(limit_value=datetime.date(1900, 1, 1)), django.core.validators.MaxValueValidator(limit_value=datetime.date(2023, 11, 19))], verbose_name='Дата рождения'), | ||
), | ||
migrations.DeleteModel( | ||
name='VolunteerFavorite', | ||
), | ||
migrations.AddConstraint( | ||
model_name='projectfavorite', | ||
constraint=models.UniqueConstraint(fields=('user', 'project'), name='projects_projectfavorite_unique_project_in_favorite'), | ||
), | ||
] |
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