question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QSelect not honoring input_style argument

See original GitHub issue

Loving JustPy! However, when I add an input_style argument to a QSelect it doesn’t honor the input style, it overrides it with the default color.

For example: jp.QSelect(input_style='color:#0088cc !important;text-decoration: underline dotted')

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
knoxvilledatabasecommented, Mar 12, 2020

Right! There is no longer a need for Django REST, JustPy can communicate directly to the Django ORM on the backend without the need for AJAX/JSON/REST calls from the front end.

Just import your Django Project with:

sys.path.append('../path_to_project') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') from django import setup setup()

Import your django models: from my_django_project.models import MyModel

Now JustPy can communicate directly to the Django ORM without the need for Django REST. Here is a simple class that changes a Django model without REST:

import justpy as jp

class ChangeDjangoModelFromJustPy(jp.QDiv):     def __init__(self, **kwargs):         super().__init__(**kwargs)         self.django_model = kwargs.get('django_model', None)         self.django_instance_id = kwargs.get('django_instance_id', None)         self.django_field_to_change = kwargs.get('django_field_to_change', None)         self.new_django_value_to_set = kwargs.get('new_django_value_to_set', None)         jp.QBtn(text=kwargs['button_text'], click=self.change_django_model, a=self)

    def change_django_model(self, msg, target):         kwargs={self.django_field_to_change: self.new_django_value_to_set}         self.django_model.objects.filter(id=self.django_instance_id).update(**kwargs)

ChangeDjangoModelFromJustPy(     django_model=MyModel,     django_instance_id=1,     django_field_to_change='enabled',     new_django_value_to_set=False,     button_text='Change Any Value on Any Field on Any Django Model with No REST API',     a=wherever_you_want, )

So elegant and powerful!

Credit for the JustPy Django integration goes to https://github.com/johnrtipton

0reactions
elimintzcommented, Mar 12, 2020

Beautiful! Thanks,

Read more comments on GitHub >

github_iconTop Results From Across the Web

QSelect input-class and input-style don't seem to work #13631
Selected option does not seem to reflect input-style and/or input-class when applied to QSelect . <q-select v-model="model" :options="options" ...
Read more >
Select | Quasar Framework
The QSelect Vue component has two types of selection - single or multiple. This component opens up a menu for the selection list...
Read more >
quasar: How to pass custom parameters to q-select filter
I need to pass extra parameters to the function. The passed update() function as an argument is critical for the select to display...
Read more >
Set input color for QSelect | Quasar Framework Community
I've tried to set the input color of QSelect using “color” / “input-class” / “input-style” as shown in docs -> QSelect API ->...
Read more >
AutoCAD 2D and 3D Masterclass | Shivam Jogi - Skillshare
So when I open this new template, it is set to architects and arguments by default. And I do not have to loop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found