GithubHelp home page GithubHelp logo

django-bootstrap-datepicker's People

Contributors

flipperpa avatar pbucher avatar relll avatar thecthulhukid avatar ypcrumble 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

Watchers

 avatar  avatar  avatar  avatar

django-bootstrap-datepicker's Issues

TypeError: build_attrs() takes from 1 to 2 positional arguments but 3 were given

Hi, I'm experiencing the below error using django v1.10.2:

Django Version: 	1.10.2
Exception Type: TypeError
Exception Value: build_attrs() takes from 1 to 2 positional arguments but 3 were given
Exception Location: .../bootstrap_datepicker/widgets.py in render, line 115

The culprit seems to be the below line as build_attrs doesn't expect attrs:

input_attrs = self.build_attrs(attrs, extra_attrs)

Replacing the above with:

if attrs:
    self.attrs.update(attrs)
input_attrs = self.build_attrs(extra_attrs)

seems to work.

[Question] Multidate Picker

Hi, I would like to use this as a multidate picker for scheduling. My thinking was to use a ForeignKey field to connect the to and use that to populate the DatePicker. Is this the best way to do this?

class Product(models.Model):
    desc = models.charfield()

class ProductBooking(models.Model):
    product = models.ForeignKey('catalogue.Product')
    booking_date = models.DateField()

JS file corrupted

When used out of the box I get a JS console error telling me datepicker is not a function. Dropping in the bootstrap-datepicker.js from the CDN (instead of using the one under /static) resolved the issue for me.

JSFiles object is not reversible

In DJango 2.0, JSFiles object needs to be reversible, otherwise it raises an error

TypeError at /some_url
'JSFiles' object is not reversible

The issue can be solved by either renaming the __iter__ method to __reversed__ or by adding a __reversed__ method to JSFiles Object. Adding a method instead of renaming keeps backward compatibility.

Django 1.11 issue

At least I think it is a 1.11 issue.

When trying to use the widget as is I got an unexpected argument exception on the line
input_attrs = self.build_attrs(attrs, type=self.input_type, name=name)

I fixed it by adding the type and name to the attrs manually beforehand.

[Question] Inline

I would like the datepicker to display all the time (as inline) how do I need to change the widget to do this?

Make the datepicker work with default options set

Rather than omitting the javascript initialization if the options parameter isn't set, it would be nice if the DatePicker simply chose default options. Probably the two already in the readme.

Let me know if this is helpful and happy to make a PR.

_format_value error .

You might get the following error in recent Django versions:
'DatePicker' object has no attribute '_format_value'

The reason:
Django 2.0: Widget.format_value has been renamed from _format_value to format_value to make it a part of the public API.

I made a fix in my fork by changing the function name in widget.py file . Works fine.

TypeError: render() got an unexpected keyword argument 'renderer'

On Django 2.1 I get the follwing traceback when adding the DatePicker widget, while on Django 2.0 it works fine:

Traceback (most recent call last):
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/core/handlers/base.py", line 156, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/core/handlers/base.py", line 154, in _get_response
    response = response.render()
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/response.py", line 106, in render
    self.content = self.rendered_content
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/response.py", line 83, in rendered_content
    content = template.render(context, self._request)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 171, in render
    return self._render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/template/library.py", line 192, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/templatetags/bootstrap4.py", line 421, in bootstrap_form
    return render_form(*args, **kwargs)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/forms.py", line 39, in render_form
    return renderer_cls(form, **kwargs).render()
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/renderers.py", line 77, in render
    return mark_safe(self._render())
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/renderers.py", line 208, in _render
    return self.render_errors() + self.render_fields()
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/renderers.py", line 174, in render_fields
    bound_css_class=self.bound_css_class,
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/forms.py", line 55, in render_field
    return renderer_cls(field, **kwargs).render()
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/renderers.py", line 77, in render
    return mark_safe(self._render())
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/bootstrap4/renderers.py", line 508, in _render
    html = self.field.as_widget(attrs=self.widget.attrs)
  File "/home/hexa/.local/share/virtualenvs/devconf3-uk6jVlS4/lib/python3.6/site-packages/django/forms/boundfield.py", line 93, in as_widget
    renderer=self.form.renderer,
TypeError: render() got an unexpected keyword argument 'renderer'

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.