Created
March 3, 2017 22:01
-
-
Save imagescape/31c373263d77efd7be44a794cbb67a5d to your computer and use it in GitHub Desktop.
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
## models.py | |
class HourRange(models.Model): | |
practice = models.ForeignKey(Practice) | |
rules = rec_fields.RecurrenceField( | |
help_text='recurrences for this hour range' | |
) | |
opening_time = models.TimeField(blank=True, null=True) | |
closing_time = models.TimeField(blank=True, null=True) | |
message = models.TextField(blank=True, null=True) | |
normal_hours = models.BooleanField(blank=True, default=False) | |
## admin.py | |
class HourRangeInline(admin.TabularInline): | |
model = models.HourRange | |
class PracticeAdmin(admin.ModelAdmin): | |
... | |
inlines = (PracticeTypeInline, ServiceInline, ManagerInline, HourRangeInline) | |
... | |
admin.site.register(models.Practice, PracticeAdmin) | |
admin.site.register(models.HourRange) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment