create Event with preselected place

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

create Event with preselected place

Oliver Lehmann
Hi,

I'm going to enter all birth, baptism, deaths and burrials from a  
single village in gramps (870 marriages nearly 100% done). For my  
selected timeframe it would be around 2000 events each. All events  
took place in this single village. It would dramatically save a lot of  
time if the village itself would be preselected as place for each  
event. I already changed the order of "the next" event from birth and  
death to birth, baptism, death, burrial in the source.

Is there also a possibility to configure some sort of "default" place?

Otherwise the only option I see is to record another keyboard macro to  
create a new event, navigate to the place row, select the place,  
navigate back to the date field... some sort of preselection would be  
faster though.

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

prculley
If you are willing to patch the code (perhaps temporarily) you could make a change so that ALL new events get a pre-selected place.

First identify the place; export your tree to XML (or a small section of it) with at least one person having an event with the referenced place.
Do not use compression in the export.
Find the place in the XML file and note the "handle=" value; without the leading '_'.  A typical place looks something like this:
  <places>
    <placeobj handle="_08TJQCCFIX31BXPNXN" change="1234390730" id="P0860" type="City">
      <ptitle>Gainesville, TX</ptitle>
      <pname value="Gainesville"/>
      <coord long="-97.1333453" lat="33.6259414"/>
      <placeref hlink="_c96587266e05d984a5714e93870"/>
    </placeobj>


You now have a handle that will refer to that place in your tree in that db, but only in that tree or one derived from it via XML.

Next find in your Gramps source code "gramps.gen.lib.event.py",  in the __init__ code, should be around line 89 you should see:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
just after that last line, add in self.place="08TJQCCFIX31BXPNXN" where the "08TJQCCFIX31BXPNXN" is the handle you found.  The quote characters are necessary.
It should look like this:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
        self.place="08TJQCCFIX31BXPNXN"

That should do it, let me know if it doesn't work, because I have not tested this...
Paul C.

On Sat, Sep 28, 2019 at 6:07 AM Oliver Lehmann <[hidden email]> wrote:
Hi,

I'm going to enter all birth, baptism, deaths and burrials from a 
single village in gramps (870 marriages nearly 100% done). For my 
selected timeframe it would be around 2000 events each. All events 
took place in this single village. It would dramatically save a lot of 
time if the village itself would be preselected as place for each 
event. I already changed the order of "the next" event from birth and 
death to birth, baptism, death, burrial in the source.

Is there also a possibility to configure some sort of "default" place?

Otherwise the only option I see is to record another keyboard macro to 
create a new event, navigate to the place row, select the place, 
navigate back to the date field... some sort of preselection would be 
faster though.

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Oliver Lehmann
Hi Paul,


Paul Culley <[hidden email]> wrote:

> That should do it, let me know if it doesn't work, because I have not
> tested this...


Thank you. It worked like a charm exactly like you said!

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Helge.Privat
In reply to this post by prculley
Hi Paul,
great solution. Do you have a suggestion how to use the first special tagged place (e.g. tag equals "Default_Event_Place" - if not found: empty) instead setting a place handle manually?
My Python-Gramps knowledge is to low for that.
 
Thank you.
Helge

Am 28.09.2019 um 15:24 schrieb Paul Culley <[hidden email]>:
If you are willing to patch the code (perhaps temporarily) you could make a change so that ALL new events get a pre-selected place.

First identify the place; export your tree to XML (or a small section of it) with at least one person having an event with the referenced place.
Do not use compression in the export.
Find the place in the XML file and note the "handle=" value; without the leading '_'.  A typical place looks something like this:
  <places>
    <placeobj handle="_08TJQCCFIX31BXPNXN" change="1234390730" id="P0860" type="City">
      <ptitle>Gainesville, TX</ptitle>
      <pname value="Gainesville"/>
      <coord long="-97.1333453" lat="33.6259414"/>
      <placeref hlink="_c96587266e05d984a5714e93870"/>
    </placeobj>


You now have a handle that will refer to that place in your tree in that db, but only in that tree or one derived from it via XML.

Next find in your Gramps source code "gramps.gen.lib.event.py",  in the __init__ code, should be around line 89 you should see:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
just after that last line, add in self.place="08TJQCCFIX31BXPNXN" where the "08TJQCCFIX31BXPNXN" is the handle you found.  The quote characters are necessary.
It should look like this:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
        self.place="08TJQCCFIX31BXPNXN"

That should do it, let me know if it doesn't work, because I have not tested this...
Paul C.

On Sat, Sep 28, 2019 at 6:07 AM Oliver Lehmann <[hidden email]> wrote:
Hi,

I'm going to enter all birth, baptism, deaths and burrials from a 
single village in gramps (870 marriages nearly 100% done). For my 
selected timeframe it would be around 2000 events each. All events 
took place in this single village. It would dramatically save a lot of 
time if the village itself would be preselected as place for each 
event. I already changed the order of "the next" event from birth and 
death to birth, baptism, death, burrial in the source.

Is there also a possibility to configure some sort of "default" place?

Otherwise the only option I see is to record another keyboard macro to 
create a new event, navigate to the place row, select the place, 
navigate back to the date field... some sort of preselection would be 
faster though.

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

prculley
That is not a one-liner...
You would have to scan the tag list, looking for the specific tag of interest (comparing names as you go), and then grab its handle.
You would have to scan the entire place list looking for the list of tags in each place, matching the tags against the specific tag you were looking for by its handle.
Then you can uses that specific place's handle.
Oh, since you want the 'first' place, you would have to sort the place list by your definition of what comes first, so that when you scanned that list the first found would be the one you get.

Note that doing either of these things is a quick/dirty solution.  They both would break several rules we use to try to keep Gramps code somewhat manageable.

To do it somewhat better you would have to create some sort of "New Event" Gramplet addon which is even more work.  Not something I'm likely to do anytime soon.
Paul C.

On Sat, Sep 28, 2019 at 11:47 AM Helge <[hidden email]> wrote:
Hi Paul,
great solution. Do you have a suggestion how to use the first special tagged place (e.g. tag equals "Default_Event_Place" - if not found: empty) instead setting a place handle manually?
My Python-Gramps knowledge is to low for that.
 
Thank you.
Helge

Am 28.09.2019 um 15:24 schrieb Paul Culley <[hidden email]>:
If you are willing to patch the code (perhaps temporarily) you could make a change so that ALL new events get a pre-selected place.

First identify the place; export your tree to XML (or a small section of it) with at least one person having an event with the referenced place.
Do not use compression in the export.
Find the place in the XML file and note the "handle=" value; without the leading '_'.  A typical place looks something like this:
  <places>
    <placeobj handle="_08TJQCCFIX31BXPNXN" change="1234390730" id="P0860" type="City">
      <ptitle>Gainesville, TX</ptitle>
      <pname value="Gainesville"/>
      <coord long="-97.1333453" lat="33.6259414"/>
      <placeref hlink="_c96587266e05d984a5714e93870"/>
    </placeobj>


You now have a handle that will refer to that place in your tree in that db, but only in that tree or one derived from it via XML.

Next find in your Gramps source code "gramps.gen.lib.event.py",  in the __init__ code, should be around line 89 you should see:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
just after that last line, add in self.place="08TJQCCFIX31BXPNXN" where the "08TJQCCFIX31BXPNXN" is the handle you found.  The quote characters are necessary.
It should look like this:
        if source:
            self.__description = source.description
            self.__type = EventType(source.type)
        else:
            self.__description = ""
            self.__type = EventType()
        self.place="08TJQCCFIX31BXPNXN"

That should do it, let me know if it doesn't work, because I have not tested this...
Paul C.

On Sat, Sep 28, 2019 at 6:07 AM Oliver Lehmann <[hidden email]> wrote:
Hi,

I'm going to enter all birth, baptism, deaths and burrials from a 
single village in gramps (870 marriages nearly 100% done). For my 
selected timeframe it would be around 2000 events each. All events 
took place in this single village. It would dramatically save a lot of 
time if the village itself would be preselected as place for each 
event. I already changed the order of "the next" event from birth and 
death to birth, baptism, death, burrial in the source.

Is there also a possibility to configure some sort of "default" place?

Otherwise the only option I see is to record another keyboard macro to 
create a new event, navigate to the place row, select the place, 
navigate back to the date field... some sort of preselection would be 
faster though.

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Ron Johnson
In reply to this post by Oliver Lehmann
On 9/28/19 6:04 AM, Oliver Lehmann wrote:

> Hi,
>
> I'm going to enter all birth, baptism, deaths and burrials from a single
> village in gramps (870 marriages nearly 100% done). For my selected
> timeframe it would be around 2000 events each. All events took place in
> this single village. It would dramatically save a lot of time if the
> village itself would be preselected as place for each event. I already
> changed the order of "the next" event from birth and death to birth,
> baptism, death, burrial in the source.
>
> Is there also a possibility to configure some sort of "default" place?
>
> Otherwise the only option I see is to record another keyboard macro to
> create a new event, navigate to the place row, select the place, navigate
> back to the date field... some sort of preselection would be faster though.

A more generic solution is to use the clipboard.  Drag the village to the
clipboard, and then drag it to the Place field for ever person.


--
Angular momentum makes the world go 'round.


--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Oliver Lehmann
Hi Ron,

Ron Johnson <[hidden email]> wrote:

> A more generic solution is to use the clipboard.  Drag the village  
> to the clipboard, and then drag it to the Place field for ever person.

Yeah I use the clipboard often - but when it comes to around 8000  
events to be created where each event has the same place it seems  
silly to waste time using the clipboard and dragging the same place  
over and over again ;)

Regards,
Oliver


--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Ron Johnson
On 9/28/19 1:13 PM, Oliver Lehmann wrote:

> Hi Ron,
>
> Ron Johnson <[hidden email]> wrote:
>
>> A more generic solution is to use the clipboard.  Drag the village to the
>> clipboard, and then drag it to the Place field for ever person.
>
> Yeah I use the clipboard often - but when it comes to around 8000 events
> to be created where each event has the same place it seems silly to waste
> time using the clipboard and dragging the same place over and over again ;)

Last Used Place might also be a more universal solution.  In the easiest
implementation, the value probably wouldn't survive a Gramps restart, but
that's not too onerous.


--
Angular momentum makes the world go 'round.


--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

StoltHD
In reply to this post by Oliver Lehmann
I would have recorded all events in a spreadsheet and imported it from csv. If you use excel, you can create a table, make a few formulas to add repeating values, and just type...


From: Oliver Lehmann <[hidden email]>
Sent: Saturday, September 28, 2019 1:04:46 PM
To: [hidden email] <[hidden email]>
Subject: [Gramps-users] create Event with preselected place
 
Hi,

I'm going to enter all birth, baptism, deaths and burrials from a 
single village in gramps (870 marriages nearly 100% done). For my 
selected timeframe it would be around 2000 events each. All events 
took place in this single village. It would dramatically save a lot of 
time if the village itself would be preselected as place for each 
event. I already changed the order of "the next" event from birth and 
death to birth, baptism, death, burrial in the source.

Is there also a possibility to configure some sort of "default" place?

Otherwise the only option I see is to record another keyboard macro to 
create a new event, navigate to the place row, select the place, 
navigate back to the date field... some sort of preselection would be 
faster though.

Best regards,
Oliver



--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org


--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org
Reply | Threaded
Open this post in threaded view
|

Re: create Event with preselected place

Oliver Lehmann
Hi,

wouldn't this just end up in a different set of complications?

Yes, I could type in the persons faster than doing it in Gramps but...
- I would have to type also the parents for each child again and again
- I probably get matching problems because sometimes you have same  
parents with different spelling like
John Peter Walter Doe
John Doooo
Peter Walter Dhoe
- I have most of the parents already in Gramps - how are they matched  
with the parents I specify in the CSV
- Same with the children itself - many of them (including birth) are  
already in the database because of their marriage I already recorded

and so on....

I most likely just end up with "different problems" and I consider the  
csv way probably being faster in getting the things in an electronic  
form but having hard time "correcting" the imported data afterwars. I  
fear that I miss something and have bad data in my tree after the  
import so I consider entering the data directly in gramps the more  
accurate way.

Best regards,
Oliver


StoltHD <[hidden email]> wrote:

> I would have recorded all events in a spreadsheet and imported it  
> from csv. If you use excel, you can create a table, make a few  
> formulas to add repeating values, and just type...
>
> ________________________________
> From: Oliver Lehmann <[hidden email]>
> Sent: Saturday, September 28, 2019 1:04:46 PM
> To: [hidden email] <[hidden email]>
> Subject: [Gramps-users] create Event with preselected place
>
> Hi,
>
> I'm going to enter all birth, baptism, deaths and burrials from a
> single village in gramps (870 marriages nearly 100% done). For my
> selected timeframe it would be around 2000 events each. All events
> took place in this single village. It would dramatically save a lot of
> time if the village itself would be preselected as place for each
> event. I already changed the order of "the next" event from birth and
> death to birth, baptism, death, burrial in the source.
>
> Is there also a possibility to configure some sort of "default" place?
>
> Otherwise the only option I see is to record another keyboard macro to
> create a new event, navigate to the place row, select the place,
> navigate back to the date field... some sort of preselection would be
> faster though.
>
> Best regards,
> Oliver
>
>
>
> --
> Gramps-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-users
> https://gramps-project.org




--
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
https://gramps-project.org