revolutiontech / django-conditions Goto Github PK
View Code? Open in Web Editor NEWA Django app that allows creation of conditional logic in admin.
License: ISC License
A Django app that allows creation of conditional logic in admin.
License: ISC License
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.