Skip to content

Commit

Permalink
Merge branch 'master' into map-nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna-Baldwa authored Aug 1, 2023
2 parents 0a20005 + ce739b3 commit c5e4516
Show file tree
Hide file tree
Showing 23 changed files with 662 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
google_client_secret.json
locations.json
chatbot_logs.json
.vscode
upload/static
Expand Down Expand Up @@ -110,4 +111,3 @@ venv.bak/

# mypy
.mypy_cache/

3 changes: 2 additions & 1 deletion backend/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

'notifications',
'markdownify',
'buyandsell',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -207,7 +208,7 @@
# Number of seconds to count down
CELERY_DELAY = 0

DEFAULT_FROM_EMAIL = 'webmaster@localhost'
# DEFAULT_FROM_EMAIL = 'webmaster@localhost'

COMPLAINT_AUTO_SUBSCRIBE = True

Expand Down
2 changes: 2 additions & 0 deletions backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ def api_base(prefix=None):
path(api_base(), include('querybot.urls')),
path(api_base(), include('external.urls')),
path(api_base(), include('community.urls')),
path(api_base(), include('buyandsell.urls')),
path(api_base('venter'), include("venter.urls")),


# Non-API
path('', include('prerender.urls')),
path(api_base('docs'), schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
Expand Down
Empty file added buyandsell/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions buyandsell/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.contrib import admin

from buyandsell.models import Ban, Category, ImageURL, Product, Report

# Register your models here.
admin.site.register(Product)
admin.site.register(Category)
admin.site.register(ImageURL)
admin.site.register(Report)
admin.site.register(Ban)
6 changes: 6 additions & 0 deletions buyandsell/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class BuyandsellConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'buyandsell'
93 changes: 93 additions & 0 deletions buyandsell/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Generated by Django 3.1.12 on 2022-08-17 11:26

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

initial = True

dependencies = [
('users', '0038_auto_20210606_2237'),
]

operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.IntegerField(editable=False, primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('numproducts', models.IntegerField(default=0)),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('str_id', models.CharField(editable=False, max_length=58, null=True)),
('name', models.CharField(max_length=60)),
('description', models.TextField(blank=True, default='')),
('brand', models.CharField(blank=True, default='', max_length=60)),
('warranty', models.BooleanField(default=False)),
('packaging', models.BooleanField(default=False)),
('condition', models.CharField(choices=[('1', '01/10'), ('2', '02/10'), ('3', '03/10'), ('4', '04/10'), ('5', '05/10'), ('6', '06/10'), ('7', '07/10'), ('8', '08/10'), ('9', '09/10'), ('10', '10/10')], default='7', max_length=2)),
('action', models.CharField(choices=[('sell', 'Sell'), ('giveaway', 'Give Away'), ('rent', 'Rent')], default='sell', max_length=10)),
('status', models.BooleanField(default=True)),
('deleted', models.BooleanField(default=False)),
('price', models.IntegerField(default=100)),
('negotiable', models.BooleanField(default=True)),
('contact_details', models.CharField(max_length=300)),
('time_of_creation', models.DateTimeField(auto_now_add=True)),
('category', models.ForeignKey(default=0, on_delete=django.db.models.deletion.SET_DEFAULT, to='buyandsell.category')),
('followers', models.ManyToManyField(blank=True, related_name='_product_followers_+', to='users.UserProfile')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.userprofile')),
],
options={
'verbose_name': 'Product',
'verbose_name_plural': 'Products',
'ordering': ('-time_of_creation',),
},
),
migrations.CreateModel(
name='Report',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reason', models.TextField()),
('addressed', models.BooleanField(default=False)),
('accepted', models.BooleanField(default=False)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buyandsell.product')),
('reporter', models.ForeignKey(on_delete=models.SET('User_DNE'), to='users.userprofile')),
],
),
migrations.CreateModel(
name='Limit',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('endtime', models.DateTimeField()),
('strikes', models.IntegerField(default=0)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.userprofile')),
],
),
migrations.CreateModel(
name='ImageURL',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.URLField()),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buyandsell.product')),
],
),
migrations.CreateModel(
name='Ban',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('endtime', models.DateTimeField()),
('user', models.ManyToManyField(to='users.UserProfile')),
],
),
migrations.AddIndex(
model_name='product',
index=models.Index(fields=['time_of_creation'], name='buyandsell__time_of_5c6bcd_idx'),
),
]
38 changes: 38 additions & 0 deletions buyandsell/migrations/0002_auto_20230428_2306.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 3.2.16 on 2023-04-28 17:36

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='product',
name='product_image',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='ban',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='imageurl',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='limit',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='report',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
18 changes: 18 additions & 0 deletions buyandsell/migrations/0003_alter_product_product_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.16 on 2023-04-29 13:13

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0002_auto_20230428_2306'),
]

operations = [
migrations.AlterField(
model_name='product',
name='product_image',
field=models.URLField(blank=True, null=True),
),
]
24 changes: 24 additions & 0 deletions buyandsell/migrations/0004_auto_20230430_2232.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.2.16 on 2023-04-30 17:02

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0003_alter_product_product_image'),
]

operations = [
migrations.AlterField(
model_name='limit',
name='endtime',
field=models.DateTimeField(auto_created=True),
),
migrations.AlterField(
model_name='product',
name='category',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='buyandsell.category'),
),
]
18 changes: 18 additions & 0 deletions buyandsell/migrations/0005_alter_limit_endtime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.16 on 2023-04-30 17:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0004_auto_20230430_2232'),
]

operations = [
migrations.AlterField(
model_name='limit',
name='endtime',
field=models.DateTimeField(auto_created=True, null=True),
),
]
23 changes: 23 additions & 0 deletions buyandsell/migrations/0006_auto_20230430_2311.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.16 on 2023-04-30 17:41

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0005_alter_limit_endtime'),
]

operations = [
migrations.AlterField(
model_name='product',
name='deleted',
field=models.BooleanField(blank=True, default=False),
),
migrations.AlterField(
model_name='product',
name='status',
field=models.BooleanField(blank=True, default=True),
),
]
23 changes: 23 additions & 0 deletions buyandsell/migrations/0007_auto_20230430_2314.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.16 on 2023-04-30 17:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0006_auto_20230430_2311'),
]

operations = [
migrations.AlterField(
model_name='product',
name='deleted',
field=models.BooleanField(blank=True, default=False, null=True),
),
migrations.AlterField(
model_name='product',
name='status',
field=models.BooleanField(blank=True, default=True, null=True),
),
]
19 changes: 19 additions & 0 deletions buyandsell/migrations/0008_alter_product_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.16 on 2023-04-30 17:48

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('buyandsell', '0007_auto_20230430_2314'),
]

operations = [
migrations.AlterField(
model_name='product',
name='category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='buyandsell.category'),
),
]
30 changes: 30 additions & 0 deletions buyandsell/migrations/0009_auto_20230723_1547.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 3.2.16 on 2023-07-23 10:17

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('users', '0040_remove_userprofile_followed_communities'),
('buyandsell', '0008_alter_product_category'),
]

operations = [
migrations.AlterField(
model_name='product',
name='followers',
field=models.ManyToManyField(blank=True, related_name='productsfollowed', to='users.UserProfile'),
),
migrations.AlterField(
model_name='product',
name='product_image',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='product',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='users.userprofile'),
),
]
Empty file.
Loading

0 comments on commit c5e4516

Please sign in to comment.