dakrauth / django-swingtime Goto Github PK
View Code? Open in Web Editor NEW๐ Event and occurrence scheduling application for Django
Home Page: https://dakrauth.github.io/django-swingtime/
License: MIT License
๐ Event and occurrence scheduling application for Django
Home Page: https://dakrauth.github.io/django-swingtime/
License: MIT License
I followed the instructions, but when I bring up the page, nothing shows up. I tried including the demo urls, but it doesn't reach. Not exactly sure how to get this working.
I encountered this issue when creating an event whose title is "Dรฉbut stage".
The line in cause is the 206th from the file /site-packages/swingtime/models.py when the occurrence is outputted as string.
/site-packages/swingtime/models.py
204 #---------------------------------------------------------------------------
205 def str(self):
206 return '{}: {}'.format(self.title, self.start_time.isoformat())
Hi there,
From documentation I found that URL does not work.
I'm helping a non-profit with their main event calendar. As you might imagine, its a bit busy!
I need to improve the day-cell layout. For example, they would like morning events to appear in the top half of the cell, mid-day (or all day) events in the middle, and evening events in the bottom half. With a white space gap between the three.
I also added the option of displaying an icon in place of (or with) the event name. So things like Remembrance day (Nov 11) is the Poppy icon. Christmas is a decorated Xmas tree, etc.
Before I start making changes to my fork, I wanted to check and see if any work or thoughts in this direction already exist.
Thanks in advance!
Would it be possible to update the documentation with some examples on how to correlate the models that swingtime provides with my own. So for example one would be able to have specific events for different users.
Or possibly edit the karate example to showcase such functionality. Thinking about it, a nice feature would be email notifications for expiring events. I don't know if this exists already in Django, I am just throwing it as an idea.
Thanks.
I hope you find this interesting. It could be a viable method of allowing "infinitely" recurring events.
While comparing different calendar/scheduling packages for Django, I've noticed that mostly they follow the same pattern of implementation: having a recurring event and occurences written to the database when the event is created, and allowing additional occurences to be added manually, except django-scheduler that does the complete opposite: relying completely on rrule to calculate and return an occurence should it be looked up, and storing an occurence only if it's unique in some way.
I think the advantages of either method comes down to performance and convenience. I would like my users to be able set up a schedule once and never having to think about it again, but that means I would have to set up a scheduled task to generate occurences for them every now and then if I use django-swingtime. Otherwise I could rely on rrule to do the job, but I think this could horribly affect performance if a large amount of users have to wait for rrule to calculate an occurence's existense when it's looked up. ( I don't know much about this, so forgive me if I'm wrong )
So what about a combination of both? I suggest keeping the current method of storing occurences to the database, but if an occurrence-lookup fails it uses rrule-arguments stored in the Event model to decide if the event should have an occurence there.
Add a setup.py file to enable easy use of this app via pip.
I see the release notes here:
http://dakrauth.github.io/django-swingtime/changes.html#release-1-1-0-feb-16-2019
I do not see it in pypi or under the Releases section in GitHub. Is it going to be released?
I have an existing application that augments swingtime.Event by inheriting from it. This has worked, but I'm running into issues as I upgrade to Django 1.9 (from Django 1.3). There are no swingtime migrations. Not sure what the best way to handle this would be.
Also +1 for the idea of documenting how to extend swingtime. I wonder if providing an Abstract model would be possible. I think that would simplify the migration issue.
Curious if you ever thought of adding a check in the form clean method to check for overlapping occurrences with the rrules being used in the submitted form?
Thanks for the great code!
TypeError at /swingtime/
can't compare offset-naive and offset-aware datetimes
when adding to an event Occurrence
swingtime/utils.py in create_timeslot_table
if item.end_time <= dtstart:
css_class_cycles | <function css_class_cycler at 0x7f68f68dbae8> |
---|---|
dt | datetime.datetime(2019, 10, 29, 16, 42, 2, 462483) |
dtend | datetime.datetime(2019, 10, 29, 20, 30) |
dtstart | datetime.datetime(2019, 10, 29, 14, 0) |
end_time_delta | datetime.timedelta(0, 23400) |
item | <Occurrence: SZV-M: 2019-10-29T13:41:52+00:00> |
items | <QuerySet [<Occurrence: SZV-M: 2019-10-29T13:41:52+00:00>]> |
min_columns | 4 |
n | datetime.datetime(2019, 10, 29, 20, 45) |
proxy_class | <class 'swingtime.utils.DefaultOccurrenceProxy'> |
start_time | datetime.time(14, 0) |
time_delta | datetime.timedelta(0, 900) |
url - calendar/2019/10/29/ day view
Unless you've left this out on purpose...
Hi Guys
I can't seem to get to see an even I have created.
I was able to create one through the djang admin pages, but when I click on the "view on site" link i get this error:
Reverse for 'swingtime-occurrence' with arguments '('2', '6')' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Any ideas?
Thanks
Adam
Does 0.6 or later support users in different time zones?
I need to support this, but when I set Django to EST (Toronto) I got lots of naive date warnings.
I think I fixed it by adding in use of django.utils.timezone.make_aware(). I added a function to utils.py that "upgrades" any naive dates passed in to use the current TZ setting.
I assume later, when I allow each user to specify their local time zone, this will automatically update the active DJango TZ and allow them to see all events in their local time, and also to correctly interpret any created dates.
Have I totally missed the boat on how this should be handled? Or should I carry on - make some tests and issue a pull request?
Regards,
Rich.
UTILS.py:
# To fix niave datetimes:
from django.utils.timezone import make_aware, is_naive
#-------------------------------------------------------------------------------
def my_make_aware(dt):
'''
Upgrade any naive date/times to current active timezone.
If the passed in date/time already has a time zone setting,
return it as-is. (we don't want to override its TZINFO)
'''
if is_naive(dt):
return make_aware(dt)
else:
return dt
The function is used in the create timeslot table function. In 0.6 the "start_time=" line is not present. I migrated my changes to 0.7.2 but do not know yet if there is a conflict with your changes.
create_timeslot_table()::
dt = dt or datetime.now()
start_time = start_time.replace(tzinfo=dt.tzinfo) if not start_time.tzinfo else start_time
dtstart = my_make_aware(datetime.combine(dt.date(), start_time))
I also made an improvement to the STR value for the Occurrence model:
def __str__(self):
return '{}: {} for {} hour(s)'.format(self.title, localtime(self.start_time).strftime('%Y-%m-%d, %I:%M:%S %p'), str((self.end_time-self.start_time).total_seconds()/(60*60)))
Using django.utils.localtime() to convert values to the user's TZ and I think a better layout.
I looked for a way in the web user interface to add/remove/change the "Event type" values in the Karate Dojo example.
I assume this is an absent feature. If it's there and I'm not finding it, can you please point me to the URL? Or, if not there - consider this a request to the community add this as an enhancement. Thank you.
Some observations: there are "event types" of { "bbc", "adv", "bgn" } that seem to map to the White belt, Yellow belt, Green belt, Brown belt, Black belt. And then the other "event types" of { "Private Lesson", "Special Event", "Sparring", "Open Dojo" } etc. Not sure which pages dynamically generate these values fro the DB, and how they are organized yet.
Django Projects:
https://www.djangopackages.com/packages/p/django-swingtime/
Lists this as the Read The Docs page:
https://readthedocs.org/projects/django-swingtime/
But that is to a fork done years ago and never updated!
Hi there,
First of all thank you for sharing your project with us. I'm still studying your framework and the demo project, i'd like to make a few modifications on the demo project for a proof of concept for a project, for that i need to associate every event to a "room". Is there some documentation so i can i have and ideia of were this changes need to be done ?
Thank you
When we set count=0
in add_occurrences
it freezes!
Apparently the issue is with python-dateutils
, like for example,
list(rrule.rrule(rrule.DAILY, dtstart=datetime(2010,1,1,1), count=0))
will likely cause the problem ( generate an infinite list of occurrences)
What do you think we should do?
All day events for things like birthdays would be nice.
Hello! Can you upload the latest version 1.4.0 package to pypi?
Thanks in advance!
@dakrauth I'm wondering if you're planning to merge the abstract models branch anytime soon?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.