-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lots of little changes and fightijng with django to get basic things to work
- Loading branch information
1 parent
de676f3
commit 696f1b1
Showing
30 changed files
with
386 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,3 +276,5 @@ mailpit | |
wooster_django/media/ | ||
|
||
.pytest_cache/ | ||
|
||
db.sqlite3 |
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
15 changes: 15 additions & 0 deletions
15
wooster_django/basemodels/migrations/0002_delete_documentnumber.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,15 @@ | ||
# Generated by Django 4.2.7 on 2024-02-12 08:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("basemodels", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name="DocumentNumber", | ||
), | ||
] |
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,5 @@ | ||
from .abstract import BaseModel | ||
|
||
# from .shared import WhyDoesThisError | ||
|
||
__all__ = ["BaseModel"] |
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,24 @@ | ||
from django.db import models | ||
|
||
|
||
# Create your models here. | ||
class WhyDoesThisError(models.Model): | ||
document = models.CharField(max_length=50, primary_key=True, unique=True) | ||
prefix = models.CharField(max_length=10, blank=True, null=True) | ||
padding_digits = models.IntegerField(blank=True, null=True) | ||
next_counter = models.IntegerField(default=1) | ||
last_number = models.CharField(max_length=50, editable=False, null=True) | ||
last_generated_date = models.DateTimeField(auto_now=True) | ||
|
||
def get_next_number(self): | ||
prefix = self.prefix | ||
next_counter = self.next_counter | ||
padded_counter = str(next_counter).zfill(self.padding_digits) | ||
number = f"{prefix}{padded_counter}" | ||
|
||
self.next_counter += 1 | ||
self.last_number = number | ||
|
||
self.save() | ||
|
||
return number |
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,23 @@ | ||
# Generated by Django 4.2.7 on 2024-02-12 08:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("orders", "0006_order_notes_orderitem_notes_alter_orderitem_rank"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="DocumentNumbers", | ||
fields=[ | ||
("document", models.CharField(max_length=50, primary_key=True, serialize=False, unique=True)), | ||
("prefix", models.CharField(blank=True, max_length=10, null=True)), | ||
("padding_digits", models.IntegerField(blank=True, null=True)), | ||
("next_counter", models.IntegerField(default=1)), | ||
("last_number", models.CharField(editable=False, max_length=50, null=True)), | ||
("last_generated_date", models.DateTimeField(auto_now=True)), | ||
], | ||
), | ||
] |
16 changes: 16 additions & 0 deletions
16
wooster_django/orders/migrations/0008_rename_documentnumbers_documentnumber.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,16 @@ | ||
# Generated by Django 4.2.7 on 2024-02-12 09:41 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("orders", "0007_documentnumbers"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="DocumentNumbers", | ||
new_name="DocumentNumber", | ||
), | ||
] |
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
16 changes: 16 additions & 0 deletions
16
wooster_django/projects/migrations/0004_rename_documentnumber_documentnumbers.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,16 @@ | ||
# Generated by Django 4.2.7 on 2024-02-12 08:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("projects", "0003_project_order"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="DocumentNumber", | ||
new_name="DocumentNumbers", | ||
), | ||
] |
16 changes: 16 additions & 0 deletions
16
wooster_django/projects/migrations/0005_rename_documentnumbers_documentnumber.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,16 @@ | ||
# Generated by Django 4.2.7 on 2024-02-12 09:41 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("projects", "0004_rename_documentnumber_documentnumbers"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="DocumentNumbers", | ||
new_name="DocumentNumber", | ||
), | ||
] |
Oops, something went wrong.