Skip to content

Commit

Permalink
Merge pull request #155 from gcivil-nyu-org/add_price_limit
Browse files Browse the repository at this point in the history
# add price limit
  • Loading branch information
nevermoreno1 committed Apr 25, 2022
2 parents e927c27 + a91b509 commit 1d58574
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion posts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Meta:
"id": "inputItemPrice",
"placeholder": "Please Enter Item Price",
"onkeyup": r"value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')",
"maxlength": "7",
"maxlength": "5",
}
),
"category": forms.Select(
Expand Down
20 changes: 20 additions & 0 deletions posts/migrations/0002_alter_post_price.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.0.2 on 2022-04-25 09:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("posts", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="post",
name="price",
field=models.DecimalField(
blank=True, decimal_places=2, max_digits=5, null=True
),
),
]
2 changes: 1 addition & 1 deletion posts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Post(models.Model):
("other", "Other"),
)
category = models.CharField(max_length=10, choices=categories, default="Textbook")
price = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)
price = models.DecimalField(max_digits=5, decimal_places=2, null=True, blank=True)
location = models.CharField(
max_length=50,
validators=[
Expand Down

0 comments on commit 1d58574

Please sign in to comment.