Git Product home page Git Product logo

Comments (3)

ellisonbg avatar ellisonbg commented on June 29, 2024

ping @aggFTW

from qgrid.

ssanderson avatar ssanderson commented on June 29, 2024

@ellisonbg can you elaborate on what you mean by Right now, defaults are handled outside the QGridWidget class.? We maintain a global instance of _DefaultSettings in the grid module, so that you can apply settings to all the grids you create, but that's still configurable on a per-instance basis, and we should be making a copy of the settings when we instantiate a new instance. If there are bogus entries in that settings dict by default, then that's just a bug I think.

from qgrid.

ellisonbg avatar ellisonbg commented on June 29, 2024

In general, widgets and traitlets.HasTraits classes shoudl put the default
value in one of 2 locations:

  • Use the default_value kw arg to the Trait itself
  • Define a _foo_default method that returns the default.

This will enable the class to be instantiated with no explicit args if
needed, and the module level overrides will only need to set those values
that are different from the class defaults. I think it is fine to have the
module level API for settings things, but those should not contain the
defaults just overrides of the actual class defaults.

On Mon, Nov 2, 2015 at 7:49 PM, Scott Sanderson [email protected]
wrote:

@ellisonbg https://github.com/ellisonbg can you elaborate on what you
mean by Right now, defaults are handled outside the QGridWidget class.?
We maintain a global instance of _DefaultSettings in the grid module, so
that you can apply settings to all the grids you create, but that's still
configurable on a per-instance basis, and we should be making a copy of the
settings when we instantiate a new instance. If there are bogus entries in
that settings dict by default, then that's just a bug I think.


Reply to this email directly or view it on GitHub
#43 (comment).

Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]

from qgrid.

Related Issues (20)

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.