Giter Club home page Giter Club logo

django-swingtime's Introduction

๐Ÿ‡ฆ๐Ÿ‡ฉ ๐Ÿ‡ฆ๐Ÿ‡บ ๐Ÿ‡ฆ๐Ÿ‡น ๐Ÿ‡ง๐Ÿ‡ธ ๐Ÿ‡ง๐Ÿ‡ช ๐Ÿ‡ง๐Ÿ‡ฆ ๐Ÿ‡ง๐Ÿ‡ผ ๐Ÿ‡จ๐Ÿ‡ฆ ๐Ÿ‡จ๐Ÿ‡ด ๐Ÿ‡ญ๐Ÿ‡ท
๐Ÿ‡จ๐Ÿ‡ฟ ๐Ÿ‡ฉ๐Ÿ‡ฐ ๐Ÿ‡ช๐Ÿ‡ช ๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ญ๐Ÿ‡บ ๐Ÿ‡ฎ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡ฎ๐Ÿ‡ช
๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฑ๐Ÿ‡ป ๐Ÿ‡ฑ๐Ÿ‡ฎ ๐Ÿ‡ฑ๐Ÿ‡บ ๐Ÿ‡ฒ๐Ÿ‡ฝ ๐Ÿ‡ฒ๐Ÿ‡จ ๐Ÿ‡ฒ๐Ÿ‡ณ ๐Ÿ‡ฒ๐Ÿ‡ช ๐Ÿ‡ณ๐Ÿ‡ฑ
๐Ÿ‡ณ๐Ÿ‡ฟ ๐Ÿ‡ต๐Ÿ‡ญ ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ธ๐Ÿ‡ฒ ๐Ÿ‡ธ๐Ÿ‡ฌ ๐Ÿ‡ธ๐Ÿ‡ฝ ๐Ÿ‡ธ๐Ÿ‡ฐ ๐Ÿ‡ธ๐Ÿ‡ฎ ๐Ÿ‡ฟ๐Ÿ‡ฆ ๐Ÿ‡ฐ๐Ÿ‡ท
๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ง๐Ÿ‡ฑ ๐Ÿ‡ธ๐Ÿ‡ช ๐Ÿ‡จ๐Ÿ‡ญ ๐Ÿ‡น๐Ÿ‡ผ ๐Ÿ‡น๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ ๐Ÿ‡บ๐Ÿ‡ธ
๐Ÿ‡ป๐Ÿ‡ฆ ๐Ÿ‡ป๐Ÿ‡ณ ๐Ÿ‡ฟ๐Ÿ‡ฒ ๐Ÿ‡ฟ๐Ÿ‡ผ

django-swingtime's People

Contributors

brousch avatar dakrauth avatar erfaan avatar ianco avatar muelli avatar raphaelmerx avatar siolag161 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-swingtime's Issues

Detecting Overlapping Events

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!

How do you install the demo?

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.

Support for multiple timezones

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.

Dict or List format of daily events for more sophisticated monthly calendar layouts

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!

Reverse for 'swingtime-occurrence' ....

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

TypeError - can't compare offset-naive and offset-aware datetimes

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

Event title error when containing special characters like "รฉ" : 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)

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())

Web user interface for add/remove/change of "Event type"?

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.

Freeze when count = 0 is passed

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?

Suggestion: allow programmatically generated occurences

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.

Documentation on correlating a swingtime model with my own models.

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.

Recent documents

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

Swingtime migrations

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.