Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3754076
Update psycopg2 from 2.8.6 to 2.9.2
pyup-bot Nov 15, 2021
d684f9a
Update psycopg2 from 2.8.6 to 2.9.2
pyup-bot Nov 15, 2021
7f5fde9
Update psycopg2 from 2.8.6 to 2.9.2
pyup-bot Nov 15, 2021
a7a1b58
Update gevent from 21.1.2 to 21.8.0
pyup-bot Nov 15, 2021
f96c03a
Update django-environ from 0.4.5 to 0.8.1
pyup-bot Nov 15, 2021
4d8a692
Update django-environ from 0.4.5 to 0.8.1
pyup-bot Nov 15, 2021
0c7bf3d
Update whitenoise from 5.2.0 to 5.3.0
pyup-bot Nov 15, 2021
174c8d1
Update whitenoise from 5.2.0 to 5.3.0
pyup-bot Nov 15, 2021
b0d43c7
Update django-storages from 1.11.1 to 1.12.3
pyup-bot Nov 15, 2021
285c89f
Update django-anymail from 8.3 to 8.4
pyup-bot Nov 15, 2021
812e1d6
Update wheel from 0.36.2 to 0.37.0
pyup-bot Nov 15, 2021
e2ef0fd
Update django-braces from 1.14.0 to 1.15.0
pyup-bot Nov 15, 2021
bf92d56
Update django-crispy-forms from 1.11.2 to 1.13.0
pyup-bot Nov 15, 2021
a2ca57f
Update django-model-utils from 4.1.1 to 4.2.0
pyup-bot Nov 15, 2021
34737bb
Update pillow from 8.2.0 to 8.4.0
pyup-bot Nov 15, 2021
2b59226
Update argon2-cffi from 20.1.0 to 21.1.0
pyup-bot Nov 15, 2021
3e8c178
Update django-allauth from 0.44.0 to 0.45.0
pyup-bot Nov 15, 2021
834ae63
Update pytz from 2021.1 to 2021.3
pyup-bot Nov 15, 2021
a42c05b
Update django-redis from 4.12.1 to 5.0.0
pyup-bot Nov 15, 2021
6d6e62d
Update celery from 5.1.0 to 5.2.0
pyup-bot Nov 15, 2021
c78e9d5
Update boto3 from 1.17.84 to 1.20.5
pyup-bot Nov 15, 2021
7bd9a0c
Update xlsxwriter from 1.4.3 to 3.0.2
pyup-bot Nov 15, 2021
d450585
Update pyxero from 0.9.2 to 0.9.3
pyup-bot Nov 15, 2021
d52e135
Update pyyaml from 5.4.1 to 6.0
pyup-bot Nov 15, 2021
cd7a683
Update pandas from 1.2.4 to 1.3.4
pyup-bot Nov 15, 2021
3f00a0f
Update numpy from 1.20.3 to 1.21.4
pyup-bot Nov 15, 2021
809721e
Update django-tables2 from 2.4.0 to 2.4.1
pyup-bot Nov 15, 2021
70ba669
Update requests from 2.25.1 to 2.26.0
pyup-bot Nov 15, 2021
a2603ae
Update tablib from 3.0.0 to 3.1.0
pyup-bot Nov 15, 2021
3574add
Update coverage from 5.5 to 6.1.2
pyup-bot Nov 15, 2021
a082569
Update coverage from 5.5 to 6.1.2
pyup-bot Nov 15, 2021
083713c
Update django-coverage-plugin from 1.8.0 to 2.0.2
pyup-bot Nov 15, 2021
7a9c598
Update sphinx from 4.0.2 to 4.3.0
pyup-bot Nov 15, 2021
003e4bb
Update django-extensions from 3.1.3 to 3.1.5
pyup-bot Nov 15, 2021
e2084ea
Update werkzeug from 2.0.1 to 2.0.2
pyup-bot Nov 15, 2021
0dda635
Update factory-boy from 3.2.0 to 3.2.1
pyup-bot Nov 15, 2021
62a8cde
Update factory-boy from 3.2.0 to 3.2.1
pyup-bot Nov 15, 2021
6dcf15d
Update django-debug-toolbar from 3.2.1 to 3.2.2
pyup-bot Nov 15, 2021
0c6619c
Update ipdb from 0.13.8 to 0.13.9
pyup-bot Nov 15, 2021
e297d16
Update pytest-django from 4.3.0 to 4.4.0
pyup-bot Nov 15, 2021
99b9c44
Update pytest-django from 4.3.0 to 4.4.0
pyup-bot Nov 15, 2021
17ab52f
Update python-dotenv from 0.17.1 to 0.19.2
pyup-bot Nov 15, 2021
8a9428d
Update flake8 from 3.9.2 to 4.0.1
pyup-bot Nov 15, 2021
5399270
fixup: Format Python code with Black
cclauss Nov 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bene/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
__version__ = '0.0.1'
__version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
__version__ = "0.0.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
]
)
4 changes: 2 additions & 2 deletions bene/accruals/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class AccrualsConfig(AppConfig):
name = 'accruals'
verbose_name = 'Accruals'
name = "accruals"
verbose_name = "Accruals"
29 changes: 22 additions & 7 deletions bene/accruals/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,32 @@ class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
name='AccrualsTable',
name="AccrualsTable",
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('expense_nc', models.CharField(blank=True, default='', max_length=4, verbose_name='Expense NC')),
('accruals_nc', models.CharField(max_length=4, verbose_name='Accruals NC')),
('comment', models.CharField(max_length=255, verbose_name='Comment')),
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"expense_nc",
models.CharField(
blank=True, default="", max_length=4, verbose_name="Expense NC"
),
),
(
"accruals_nc",
models.CharField(max_length=4, verbose_name="Accruals NC"),
),
("comment", models.CharField(max_length=255, verbose_name="Comment")),
],
),
]
9 changes: 5 additions & 4 deletions bene/accruals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Create your models here.
class AccrualsTable(models.Model):
expense_nc = models.CharField(verbose_name='Expense NC', max_length=4, blank=True, default='')
accruals_nc = models.CharField(verbose_name='Accruals NC', max_length=4)
comment = models.CharField(verbose_name='Comment', max_length=255)

expense_nc = models.CharField(
verbose_name="Expense NC", max_length=4, blank=True, default=""
)
accruals_nc = models.CharField(verbose_name="Accruals NC", max_length=4)
comment = models.CharField(verbose_name="Comment", max_length=255)
8 changes: 2 additions & 6 deletions bene/accruals/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
from . import views


app_name = 'accruals'
app_name = "accruals"
urlpatterns = [
url(
regex=r'^$',
view=views.HomeView.as_view(),
name='home'
),
url(regex=r"^$", view=views.HomeView.as_view(), name="home"),
]
11 changes: 6 additions & 5 deletions bene/accruals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@

from .models import AccrualsTable


class HomeView(LoginRequiredMixin, TemplateView):
template_name = 'accruals/accruals_home.html'
redirect_field_name = ''
template_name = "accruals/accruals_home.html"
redirect_field_name = ""

# model = Report TODO

def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)

context.update({'test': 'Hi from accruals',
'accruals': AccrualsTable.objects.all()
})
context.update(
{"test": "Hi from accruals", "accruals": AccrualsTable.objects.all()}
)
return context
9 changes: 4 additions & 5 deletions bene/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
register_signal(client, ignore_expected=True)

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.production')
app = Celery('bene')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
app = Celery("bene")

# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
app.config_from_object('django.conf:settings')
app.config_from_object("django.conf:settings")
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
# app.config_from_object('django.conf:settings', namespace='CELERY')
Expand All @@ -43,10 +43,9 @@

@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
print("Request: {0!r}".format(self.request))


@app.task(bind=True)
def reload_task(self, xero_values):
reload_data(xero_values)

35 changes: 24 additions & 11 deletions bene/contrib/sites/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,36 @@ class Migration(migrations.Migration):

operations = [
migrations.CreateModel(
name='Site',
name="Site",
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('domain', models.CharField(
max_length=100, verbose_name='domain name', validators=[_simple_domain_name_validator]
)),
('name', models.CharField(max_length=50, verbose_name='display name')),
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
),
),
(
"domain",
models.CharField(
max_length=100,
verbose_name="domain name",
validators=[_simple_domain_name_validator],
),
),
("name", models.CharField(max_length=50, verbose_name="display name")),
],
options={
'ordering': ('domain',),
'db_table': 'django_site',
'verbose_name': 'site',
'verbose_name_plural': 'sites',
"ordering": ("domain",),
"db_table": "django_site",
"verbose_name": "site",
"verbose_name_plural": "sites",
},
bases=(models.Model,),
managers=[
('objects', django.contrib.sites.models.SiteManager()),
("objects", django.contrib.sites.models.SiteManager()),
],
),
]
12 changes: 7 additions & 5 deletions bene/contrib/sites/migrations/0002_alter_domain_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
class Migration(migrations.Migration):

dependencies = [
('sites', '0001_initial'),
("sites", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name='site',
name='domain',
model_name="site",
name="domain",
field=models.CharField(
max_length=100, unique=True, validators=[django.contrib.sites.models._simple_domain_name_validator],
verbose_name='domain name'
max_length=100,
unique=True,
validators=[django.contrib.sites.models._simple_domain_name_validator],
verbose_name="domain name",
),
),
]
18 changes: 5 additions & 13 deletions bene/contrib/sites/migrations/0003_set_site_domain_and_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,24 @@

def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model('sites', 'Site')
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
'domain': 'bene.drummonds.net',
'name': 'bene'
}
id=settings.SITE_ID, defaults={"domain": "bene.drummonds.net", "name": "bene"}
)


def update_site_backward(apps, schema_editor):
"""Revert site domain and name to default."""
Site = apps.get_model('sites', 'Site')
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
'domain': 'example.com',
'name': 'example.com'
}
id=settings.SITE_ID, defaults={"domain": "example.com", "name": "example.com"}
)


class Migration(migrations.Migration):

dependencies = [
('sites', '0002_alter_domain_unique'),
("sites", "0002_alter_domain_unique"),
]

operations = [
Expand Down
99 changes: 64 additions & 35 deletions bene/product/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,89 @@

from .models import Product, Sku, Size, Spec, Material


class SkuInline(admin.StackedInline):
model = Sku
extra = 1


class SizeAdmin(admin.ModelAdmin):
list_display = ['variant', 'sage_size', 'bed_size', 'imperial_width', 'imperial_length',
'metric_width', 'metric_length',
'amazon', 'description_long', ]
list_display = [
"variant",
"sage_size",
"bed_size",
"imperial_width",
"imperial_length",
"metric_width",
"metric_length",
"amazon",
"description_long",
]


class ProductAdmin(admin.ModelAdmin):
list_display = ['descriptive_content', 'id', 'product_type', 'product_code_root', 'bullet_point_1', 'bullet_point_2', 'bullet_point_3']
list_display = [
"descriptive_content",
"id",
"product_type",
"product_code_root",
"bullet_point_1",
"bullet_point_2",
"bullet_point_3",
]
inlines = [SkuInline]
formfield_overrides = {
models.CharField: {'widget': TextInput(attrs={'size':'100'})},
models.TextField: {'widget': Textarea(attrs={'rows':4, 'cols':40})},
models.CharField: {"widget": TextInput(attrs={"size": "100"})},
models.TextField: {"widget": Textarea(attrs={"rows": 4, "cols": 40})},
}


fieldsets = (
(None,
{'fields': (
'descriptive_content',
'product_type',
'product_code_root',
'material',
'ebay_material',
'ebay_features',
'ebay_type',
'bullet_point_1',
'bullet_point_2',
'bullet_point_3',
'bullet_point_4',
'bullet_point_5',)
}
),
('Advanced options', {
'classes': ('wide', 'collapse',),
'fields': ( 'manufacturer_description',
'factory_description',
'sage_description',
'sage_category',
'in_the_box',
'keywords')

}),
(
None,
{
"fields": (
"descriptive_content",
"product_type",
"product_code_root",
"material",
"ebay_material",
"ebay_features",
"ebay_type",
"bullet_point_1",
"bullet_point_2",
"bullet_point_3",
"bullet_point_4",
"bullet_point_5",
)
},
),
(
"Advanced options",
{
"classes": (
"wide",
"collapse",
),
"fields": (
"manufacturer_description",
"factory_description",
"sage_description",
"sage_category",
"in_the_box",
"keywords",
),
},
),
)


class SpecAdmin(admin.ModelAdmin):
list_display = ['quilting_pattern', 'fixing']
list_display = ["quilting_pattern", "fixing"]


class MaterialAdmin(admin.ModelAdmin):
list_display = ['description', 'material', 'thread_count', 'weight']
list_display = ["description", "material", "thread_count", "weight"]


admin.site.register(Product, ProductAdmin)
admin.site.register(Size, SizeAdmin)
Expand Down
2 changes: 1 addition & 1 deletion bene/product/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ProductConfig(AppConfig):
name = 'product'
name = "product"
Loading