Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

# -*- coding: UTF-8 -*- 

# Copyright 2012-2015 Luc Saffre 

# License: BSD (see file COPYING for details) 

 

""" 

""" 

from builtins import range 

 

from lino.utils import Cycler 

from lino.api import dd, rt 

from lino.utils import demonames 

 

 

def objects(): 

 

    last_names = demonames.LAST_NAMES_BELGIUM 

    male_first_names = demonames.MALE_FIRST_NAMES_FRANCE 

    female_first_names = demonames.FEMALE_FIRST_NAMES_FRANCE 

 

    Person = rt.modules.contacts.Person 

    Place = rt.modules.countries.Place 

 

    CITIES = Cycler( 

        Place.objects.filter(country_id='BE', zip_code__startswith='40')) 

    STREETS = Cycler(demonames.streets_of_liege()) 

 

    common = dict(language='fr', country_id='BE') 

    for i in range(100): 

        yield Person( 

            first_name=male_first_names.pop(), 

            last_name=last_names.pop(), 

            gender=dd.Genders.male, 

            city=CITIES.pop(), 

            street=STREETS.pop(), 

            **common 

        ) 

        yield Person( 

            first_name=female_first_names.pop(), 

            last_name=last_names.pop(), 

            gender=dd.Genders.female, 

            city=CITIES.pop(), 

            street=STREETS.pop(), 

            **common 

        )