Code Monkey home page Code Monkey logo

django-schedule's People

Contributors

akurdyukov avatar bartekgorny avatar charlieman avatar cyberj avatar danielgatis avatar gregplaysguitar avatar jpic avatar justquick avatar rockhoward avatar skyl avatar sontek avatar tgecho avatar thauber avatar winhamwr avatar yml avatar zain 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

Watchers

 avatar  avatar  avatar

django-schedule's Issues

Repeated queries for simple calendar

This is related to issue 29 in thauber's fork, but I thought I'd post here as that one seems dead, and the code in question is most likely shared between forks.

This app seems to be duplicating queries. I thought it was my usage that was the problem, but even the project_sample code generates 66 queries to display a weekly view of a calendar -- on a week with no events. Using debug_toolbar, I can see queries like

SELECT "schedule_occurrence"."id", "schedule_occurrence"."event_id", "schedule_occurrence"."title", "schedule_occurrence"."description", "schedule_occurrence"."start", "schedule_occurrence"."end", "schedule_occurrence"."cancelled", "schedule_occurrence"."original_start", "schedule_occurrence"."original_end" FROM "schedule_occurrence" WHERE "schedule_occurrence"."event_id" = 1

being run for event_id 1 to 7, and being run 8 times each.

In answer to the questions for the thauber bug: I'm not using caching, and I'm not using select_related. I'm just running the example project given. The same thing happens for my own project, and I'm just using the template tags as provided.

Is this the expected behaviour?

occurrences_after relays on Event.end_recurring_period to be present

The occurrences_after() methods relay on Event.end_recurring_period field to be present/not null/None and error. But Event can have it's duration ended by some other parameter.

Fix is quite simple: on line 162 of schedule/models/events.py add a check for end_recurring_period.

Difference between get_occurrence() and get_occurrences()?

Pardon me if I'm missing something, but I've been trying to get an events occurrences, preferably for a given day.

When I use event.get_occurrence(date), it always returns nothing. But when I use event.get_occurrences(before_date, after_date), suddenly the occurrences on the previously attempted date show up.

Why won't this work with just one datetime object?

Is there any central repo?

Hi!

I would like to package this for Debian, thus I wonder if there is any
central repo that I can use as upstream source?

Checking the huge network graph and merging what I like is not a
viable solution for package maintanence.

Thanks,
Per

Feeds generates type error

Testing the project_sample site, and when trying to use feeds, Django raises Type error

Django Version: 1.3
Exception Type: TypeError
Exception Value:
init() takes exactly 3 arguments (1 given)

Traceback:
File "Some-path/env/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "Some-path/env/lib/python2.6/site-packages/django/contrib/syndication/views.py" in feed
  2.     instance = f()
    

Events that begin at midnight show up on the previous day in the month and year templates.

Any time I create an event that begins at midnight it shows up as an occurrence for the previous day.
The error appears to be in the _get_day_range and next_day methods of the Day class in periods.py

def _get_day_range(self, date):
    if isinstance(date, datetime.datetime):
        date = date.date()
    start = datetime.datetime.combine(date, datetime.time.min)
    #end = start + datetime.timedelta(days=1)
    end = datetime.datetime.combine(date, datetime.time.max)
    return start, end

def next_day(self):
    return Day(self.events, self.start + datetime.timedelta(days=1))

AttributeError at / 'AdminSite' object has no attribute 'root'

When running the devserver, it throws this exception after a lot of deprecatedwarnings...

here's the traceback

Environment:

Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.3
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'schedule']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')

Traceback:
File "/home/lacrymology/.virtualenvs/tomasneme/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1.                         request.path_info)
    
    File "/home/lacrymology/.virtualenvs/tomasneme/lib/python2.6/site-packages/django/core/urlresolvers.py" in resolve
  2.         for pattern in self.url_patterns:
    
    File "/home/lacrymology/.virtualenvs/tomasneme/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_url_patterns
  3.     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    
    File "/home/lacrymology/.virtualenvs/tomasneme/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  4.         self._urlconf_module = import_module(self.urlconf_name)
    
    File "/home/lacrymology/.virtualenvs/tomasneme/lib/python2.6/site-packages/django/utils/importlib.py" in import_module
  5. **import**(name)
    
    File "/home/lacrymology/workspace/django/bartekgorny-django-schedule-7cd4667/project_sample/../project_sample/urls.py" in
  6. (r'^admin/(.*)', admin.site.root),
    

Exception Type: AttributeError at /
Exception Value: 'AdminSite' object has no attribute 'root'

events per user not working

I m not sure if i had it configured properly or not but

  1. user1 logs in and creates an event
  2. user2 logs in and creates an event
  3. user1 logs in and sees user2 event (and vice versa)
    I skimmed over the code and it seems like its displaying ALL events (instead of his own events). Not sure if i m right. let me know

RuleForm clean_params seems overly restrictive

https://github.com/bartekgorny/django-schedule/blob/master/schedule/forms.py#L47

There is a line in clean_params that looks like:

param = (str(param[0]), [int(p) for p in param[1].split(',')])

This line prevents things like

byweekday:SU,MO,TU,WE,TH,FR,SA

My quick fix (which is somewhat to permissive) was to change the int(p) to just p. I'm guessing the better fix would be to look for places where the RRULE_WEEKDAYS are valid and check the names there?

Would it make more sense to try to pass this down to the dateutil code, and see if it likes it instead of doing this kind of work outside the dateutil code? If we just tried to construct an rrule object, could we pick up on the exception from dateutil to know if we had a valid format?

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.