-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace auto_now and auto_now_add with defaults which can be overridden #93
Conversation
@@ -15,6 +15,5 @@ celerybeat-schedule | |||
|
|||
*.DS_Store | |||
.tox/ | |||
test-runner/env/ | |||
test-runner/smartmin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't exist
csv_imports/ | ||
!smartmin/csv_imports/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need this so we exclude /csv_imports but include /smartmin/csv_imports/
@@ -37,15 +36,23 @@ class SmartModel(models.Model): | |||
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, | |||
related_name="%(app_label)s_%(class)s_creations", | |||
help_text="The user which originally created this item") | |||
created_on = models.DateTimeField(auto_now_add=True, | |||
created_on = models.DateTimeField(default=timezone.now, editable=False, blank=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank=True
and editable=False
were automatically set by auto_now
and auto_now_add
(see https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.DateField.auto_now)
@@ -240,12 +247,12 @@ def import_xls(cls, filename, user, import_params, log=None, import_results=None | |||
num_errors += 1 | |||
|
|||
except SmartImportRowError as e: | |||
error_messages.append(dict(line=line_number+1, error=text_type(e))) | |||
error_messages.append(dict(line=line_number+1, error=six.text_type(e))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making this consistent with how the method is called elsewhere in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤙
No description provided.