Code Monkey home page Code Monkey logo

tutorial-django-crispy-range-slider's Introduction

Hi there ๐Ÿ‘‹ I'm Farid aka. mmtechslv

My GitHub Stats

Anurag's GitHub stats

My top language stats!

Top Langs

tutorial-django-crispy-range-slider's People

Contributors

mmtechslv avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

gregorydsam

tutorial-django-crispy-range-slider's Issues

Initial migration fails

Hi, thanks a lot for the tutorial :-)

I cloned the project to give it a try and stumbled upon an error when running the initial migration with

python manage.py migrate

This raised the following exception

django.db.utils.OperationalError: no such table: myapp_people

So I think the issue lies here:

class AllRangeFilter(RangeFilter):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
values = [p.age for p in People.objects.all()]
min_value = min(values)
max_value = max(values)
self.extra['widget'] = CustomRangeWidget(attrs={'data-range_min':min_value,'data-range_max':max_value})
class PeopleFilter(FilterSet):
age = AllRangeFilter()
class Meta:
model = People
fields = ['age']
form = PeopleFilterFormHelper

In line 26, the AllRangeFilter is instantiated. This causes a database query in line 20.

It seems like filters.py is imported when running the migration and thus the data base query is executed. I could work around the issue by temporarily commenting line 26.

Best regards,
Lars

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.