Giter Club home page Giter Club logo

Comments (7)

sjib avatar sjib commented on August 26, 2024

@sjib to do write concept for this as discussed

from district_heating.

sjib avatar sjib commented on August 26, 2024
  • Add MANDATORY constraint to datamodel @sjib
  • Document how this constraint can be turned off if data needs to be imported that has missing Name_Number @sjib
  • Implement trigger in forms, that fill in Name_Number = obj_id if no Name_Number is added - see TWW implementation (to do add link @sjib)
  • Create sql to fill in obj_id if Name_Number is missing (Update query)

from district_heating.

sjib avatar sjib commented on August 26, 2024
  • Add MANDATORY constraint to datamodel @sjib

I saw that we also do not have MANDATORY constraints in the postgres data model of tww - discuss with Technical group

from district_heating.

sjib avatar sjib commented on August 26, 2024
  • Implement trigger in forms, that fill in Name_Number = obj_id if no Name_Number is added - see TWW implementation (to do add link @sjib)

@urskaufmann How and where did we add this in tww? In the project file or as trigger in the database?

from district_heating.

urskaufmann avatar urskaufmann commented on August 26, 2024

Name_Nummer (=Identifier) is in tww normally not defined in the project. There must be somewhere a trigger, that sets identifier = obj_id as default value. With one exception: all identifier (reach, channel, reachpoint) in vw_tww_reach do not work like this, there has to be the obj_id defined as default value. The vw_tww_reach is somewhere specially, it's to only view, where the QGIS-standard-"reuse last value" does not work...

from district_heating.

sjib avatar sjib commented on August 26, 2024

These triggers seem to be created here in tww:
https://github.com/teksi/wastewater/blob/d8a3e3a8f92be62848dfc465c6cba45b824467ca/datamodel/app/view/vw_tww_wastewater_structure.py#L277

In the final database it then looks like this:
NEW.identifier = COALESCE(NEW.identifier, NEW.obj_id);

20240527_vw_tww_wws_insert_trigger

And for cover:
20240527_vw_cover_on_insert

, CASE WHEN NEW.identifier IS NOT NULL AND NEW.identifier::text <> '' THEN NEW.identifier ELSE COALESCE( NEW.obj_id, tww_sys.generate_oid('tww_od'::text, 'structure_part'::text) ) END

from district_heating.

sjib avatar sjib commented on August 26, 2024

@urskaufmann In vw_tww_reach there is nothing defined for NEW wwn.identifier - may be that is the reason:
20240507_vw_tww_reach_insert_identifier_wwn

from district_heating.

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.