Giter Club home page Giter Club logo

django-conditions's People

Contributors

axsapronov avatar codacy-badger avatar revolutiontech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-conditions's Issues

Condition with queryset

Hi.

Your library is good!
Can you add or explain me how to add new condition type?
CompareCondition works with int/float/str. And you input your value (operand) in input HTML element.
I want write conditions with select HTML element (for example, choose one of list element, item of queryset)

Example:

# models
class Label(models.Model):
     name = models.CharField(max_length=255)

class Settings(models.Model):
     name = models.CharField(max_length=255)
     conditions = ConditionsField(definitions=conditions_from_module(...))

# and condition
class LabelCondition(Condition):
     condstr = 'label_item'
     queryset = Label.objects.all()

    def eval_operand(self, user, **kwargs):
         pass  # some code with selected label

And then I want choice an element of queryset and use it as operand variable.

Potential dependency conflicts between django-conditions and django

Hi, as shown in the following full dependency graph of django-netjsongraph, django-conditions requires django >= 2.2, < 3.1a0 , while the installed version of django (3.0.6) ,django-jsonfield 1.4.0 requires django >=1.11.
According to Pip's “first found wins” installation strategy, django 3.0.6 is the actually installed version.
Although the first found package version django 3.0.6 just satisfies the later dependency constraint (django >=1.11), it will easily cause a build failure once the updated django-jsonfield introduces a higher version of django
According to the release history of django-jsonfield, it habitually upgrates django in its recent releases. For instance, django-jsonfield 1.1.0 upgrated django’s constraint from '*' to >=1.9.0, and django-jsonfield 1.4.0 upgrated django’s constraint from >=1.9.0 to >=1.11.

Dependency tree

django-conditions - 0.9.15 
| +- django(install version:3.06 version range:>= 2.2, < 3.1a0)
| | +- pytz(install version:2019.3 version range:*)
| | +- sqlparse(install version:0.3.1 version range:*)
| +- django-jsonfield(install version:1.4.0 version range:>=1.0.1,<2.0.0a0)
| | +- django(install version:3.0.6 version range:>=1.11)
| | | +- pytz(install version:2019.3 version range:*)
| | | +- sqlparse(install version:0.3.1 version range:*)
| | +- six(install version:1.14.0 version range:*) 

Thanks for your help.
Best,
Neolith

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.