lino 25.2.3__py3-none-any.whl → 25.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. lino/__init__.py +1 -1
  2. lino/api/dd.py +11 -48
  3. lino/api/doctest.py +34 -36
  4. lino/core/actions.py +25 -23
  5. lino/core/actors.py +37 -17
  6. lino/core/choicelists.py +10 -8
  7. lino/core/dbtables.py +1 -1
  8. lino/core/elems.py +46 -30
  9. lino/core/fields.py +19 -9
  10. lino/core/inject.py +7 -6
  11. lino/core/kernel.py +26 -66
  12. lino/core/model.py +44 -31
  13. lino/core/plugin.py +4 -4
  14. lino/core/requests.py +76 -55
  15. lino/core/site.py +84 -30
  16. lino/core/store.py +5 -2
  17. lino/core/utils.py +12 -7
  18. lino/help_texts.py +3 -8
  19. lino/management/commands/prep.py +1 -1
  20. lino/mixins/duplicable.py +6 -4
  21. lino/mixins/sequenced.py +17 -6
  22. lino/modlib/__init__.py +0 -2
  23. lino/modlib/changes/models.py +21 -10
  24. lino/modlib/checkdata/models.py +59 -24
  25. lino/modlib/comments/fixtures/demo2.py +12 -3
  26. lino/modlib/comments/models.py +7 -7
  27. lino/modlib/comments/ui.py +8 -5
  28. lino/modlib/export_excel/models.py +7 -5
  29. lino/modlib/extjs/views.py +39 -20
  30. lino/modlib/help/management/commands/makehelp.py +5 -2
  31. lino/modlib/jinja/mixins.py +25 -14
  32. lino/modlib/linod/__init__.py +1 -0
  33. lino/modlib/linod/choicelists.py +21 -0
  34. lino/modlib/linod/consumers.py +13 -4
  35. lino/modlib/linod/management/commands/linod.py +6 -2
  36. lino/modlib/linod/mixins.py +16 -11
  37. lino/modlib/linod/models.py +4 -2
  38. lino/modlib/notify/models.py +18 -10
  39. lino/modlib/printing/actions.py +41 -30
  40. lino/modlib/printing/choicelists.py +11 -9
  41. lino/modlib/printing/mixins.py +25 -20
  42. lino/modlib/publisher/models.py +5 -5
  43. lino/modlib/summaries/models.py +3 -2
  44. lino/modlib/system/models.py +28 -29
  45. lino/modlib/uploads/__init__.py +5 -5
  46. lino/modlib/uploads/actions.py +2 -8
  47. lino/modlib/uploads/choicelists.py +10 -10
  48. lino/modlib/uploads/fixtures/std.py +17 -0
  49. lino/modlib/uploads/mixins.py +20 -8
  50. lino/modlib/uploads/models.py +60 -35
  51. lino/modlib/uploads/ui.py +10 -7
  52. lino/utils/media.py +45 -23
  53. lino/utils/report.py +5 -4
  54. lino/utils/soup.py +22 -4
  55. {lino-25.2.3.dist-info → lino-25.3.1.dist-info}/METADATA +1 -1
  56. {lino-25.2.3.dist-info → lino-25.3.1.dist-info}/RECORD +59 -80
  57. lino/mixins/uploadable.py +0 -3
  58. lino/sandbox/bcss/PerformInvestigation.py +0 -2260
  59. lino/sandbox/bcss/SSDNReply.py +0 -3924
  60. lino/sandbox/bcss/SSDNRequest.py +0 -3723
  61. lino/sandbox/bcss/__init__.py +0 -0
  62. lino/sandbox/bcss/readme.txt +0 -1
  63. lino/sandbox/bcss/test.py +0 -92
  64. lino/sandbox/bcss/test2.py +0 -128
  65. lino/sandbox/bcss/test3.py +0 -161
  66. lino/sandbox/bcss/test4.py +0 -167
  67. lino/sandbox/contacts/__init__.py +0 -0
  68. lino/sandbox/contacts/fixtures/__init__.py +0 -0
  69. lino/sandbox/contacts/fixtures/demo.py +0 -365
  70. lino/sandbox/contacts/manage.py +0 -10
  71. lino/sandbox/contacts/models.py +0 -395
  72. lino/sandbox/contacts/settings.py +0 -67
  73. lino/sandbox/tx25/XSD/RetrieveTIGroupsV3.wsdl +0 -65
  74. lino/sandbox/tx25/XSD/RetrieveTIGroupsV3.xsd +0 -286
  75. lino/sandbox/tx25/XSD/rn25_Release201104.xsd +0 -2855
  76. lino/sandbox/tx25/xsd2py1.py +0 -68
  77. lino/sandbox/tx25/xsd2py2.py +0 -62
  78. lino/sandbox/tx25/xsd2py3.py +0 -56
  79. {lino-25.2.3.dist-info → lino-25.3.1.dist-info}/WHEEL +0 -0
  80. {lino-25.2.3.dist-info → lino-25.3.1.dist-info}/licenses/AUTHORS.rst +0 -0
  81. {lino-25.2.3.dist-info → lino-25.3.1.dist-info}/licenses/COPYING +0 -0
@@ -1,395 +0,0 @@
1
- # -*- coding: UTF-8 -*-
2
- # Copyright 2008-2012 Rumma & Ko Ltd
3
- # License: GNU Affero General Public License v3 (see file COPYING for details)
4
- """
5
-
6
- """
7
- import six
8
- from django.conf import settings
9
- from django.db import models
10
- from django.utils.translation import gettext_lazy as _
11
- from django.utils import timezone
12
-
13
- from lino.api import dd, rt
14
- from lino_xl.lib.countries.models import CountryCity
15
- from lino.models import get_site_config
16
- from lino.utils.choicelists import Gender
17
- from lino.utils import join_words
18
-
19
-
20
- # ~ class AddressType(mixins.BabelNamed):
21
- # ~ class Meta:
22
- # ~ verbose_name = _("Address Type")
23
- # ~ verbose_name_plural = _("Address Types")
24
- # ~ class AddressTypes(dd.Table):
25
- # ~ model = AddressType
26
- # ~ column_names = 'name *'
27
- class Role(mixins.BabelNamed):
28
- class Meta:
29
- verbose_name = _("Role")
30
- verbose_name_plural = _("Roles")
31
-
32
-
33
- class Roles(dd.Table):
34
- model = Role
35
- column_names = "name *"
36
-
37
-
38
- class Address(CountryCity):
39
- class Meta:
40
- abstract = settings.SITE.abstract_address
41
- verbose_name = _("Address")
42
- verbose_name_plural = _("Addresses")
43
-
44
- addr1 = models.CharField(
45
- _("Address line before street"), max_length=200, blank=True
46
- )
47
-
48
- street_prefix = models.CharField(
49
- _("Street prefix"),
50
- max_length=200,
51
- blank=True,
52
- help_text="Text to print before name of street, but to ignore for sorting.",
53
- )
54
-
55
- street = models.CharField(
56
- _("Street"),
57
- max_length=200,
58
- blank=True,
59
- help_text="Name of street. Without house number.",
60
- )
61
-
62
- street_no = models.CharField(
63
- _("No."), max_length=10, blank=True, help_text="House number"
64
- )
65
-
66
- street_box = models.CharField(
67
- _("Box"),
68
- max_length=10,
69
- blank=True,
70
- help_text="Text to print after :attr:`steet_no` on the same line",
71
- )
72
-
73
- addr2 = models.CharField(
74
- _("Address line after street"),
75
- max_length=200,
76
- blank=True,
77
- help_text="Address line to print below street line",
78
- )
79
-
80
- zip_code = models.CharField(_("Zip code"), max_length=10, blank=True)
81
- region = models.CharField(_("Region"), max_length=200, blank=True)
82
-
83
- def __unicode__(self):
84
- return self.address_location(", ")
85
-
86
- def address_person_lines(self):
87
- # ~ yield self.name
88
- yield self.get_full_name()
89
-
90
- def get_full_name(self, *args, **kw):
91
- return self.name
92
-
93
- full_name = property(get_full_name)
94
-
95
- def address_location_lines(self):
96
- if self.addr1:
97
- yield self.addr1
98
- if self.street:
99
- yield join_words(
100
- self.street_prefix, self.street, self.street_no, self.street_box
101
- )
102
- if self.addr2:
103
- yield self.addr2
104
- if self.region: # format used in Estonia
105
- if self.city:
106
- yield six.text_type(self.city)
107
- s = join_words(self.zip_code, self.region)
108
- else:
109
- s = join_words(self.zip_code, self.city)
110
- if s:
111
- yield s
112
- if self.country is not None:
113
- sc = get_site_config()
114
- if not sc.site_company or self.country != sc.site_company.address.country:
115
- yield six.text_type(self.country)
116
-
117
- def address_lines(self):
118
- for ln in self.address_person_lines():
119
- yield ln
120
- for ln in self.address_location_lines():
121
- yield ln
122
-
123
- def postal_address(self, linesep="\n"):
124
- """
125
- The plain text full postal address (person and location).
126
- Lines are separated by `linesep`.
127
- """
128
- return linesep.join(
129
- list(self.address_person_lines()) + list(self.address_location_lines())
130
- )
131
-
132
- postal_address.return_type = models.TextField(_("Address"))
133
-
134
- def address_location(self, linesep="\n"):
135
- """
136
- The plain text postal address location part.
137
- Lines are separated by `linesep`.
138
- """
139
- return linesep.join(self.address_location_lines())
140
-
141
-
142
- class AddressDetail(dd.DetailLayout):
143
- address = """
144
- country region city zip_code
145
- addr1
146
- street_prefix street street_no street_box
147
- addr2
148
- """
149
-
150
-
151
- if settings.SITE.abstract_address:
152
- AddressableMixin = Address
153
-
154
- else:
155
-
156
- class AddressableMixin(dd.Model):
157
- class Meta:
158
- abstract = True
159
-
160
- address = dd.ForeignKey(Address, null=True, blank=True)
161
-
162
- class Addresses(dd.Table):
163
- model = Address
164
- detail_layout = AddressDetail(main="address")
165
-
166
-
167
- class Person(AddressableMixin):
168
- class Meta:
169
- verbose_name = _("Person")
170
- verbose_name_plural = _("Persons")
171
-
172
- title = models.CharField(
173
- _("Title"),
174
- max_length=200,
175
- blank=True,
176
- help_text="""
177
- Text to print as part of the first address line in front of first_name.
178
- """,
179
- )
180
- first_name = models.CharField(max_length=100)
181
- last_name = models.CharField(max_length=100)
182
- gender = Gender.field()
183
-
184
- def __unicode__(self):
185
- return self.first_name + " " + self.last_name
186
-
187
-
188
- class PersonDetail(AddressDetail):
189
- main = """
190
- title first_name last_name gender
191
- address
192
- ContactsByPerson
193
- """
194
-
195
-
196
- class Persons(dd.Table):
197
- model = Person
198
- column_names = "last_name first_name *"
199
- detail_layout = PersonDetail()
200
-
201
-
202
- class Company(AddressableMixin):
203
- class Meta:
204
- verbose_name = _("Company")
205
- verbose_name_plural = _("Companies")
206
-
207
- name = models.CharField(max_length=50)
208
-
209
- def __unicode__(self):
210
- return self.name
211
-
212
-
213
- class CompanyDetail(AddressDetail):
214
- main = """
215
- name
216
- address
217
- ContactsByCompany
218
- """
219
-
220
-
221
- class Companies(dd.Table):
222
- model = Company
223
- column_names = "name *"
224
- detail_layout = CompanyDetail()
225
-
226
-
227
- class Contact(dd.Model):
228
- class Meta:
229
- # ~ abstract = True
230
- verbose_name = _("Contact")
231
- verbose_name_plural = _("Contacts")
232
-
233
- person = dd.ForeignKey(Person, null=True, blank=True)
234
- company = dd.ForeignKey(Company, null=True, blank=True)
235
- role = dd.ForeignKey(Role, null=True, blank=True)
236
-
237
- language = dd.LanguageField()
238
-
239
- # ~ address = dd.ForeignKey(Address,null=True,blank=True)
240
- # ~ address_type = dd.ForeignKey(AddressType,blank=True,null=True)
241
-
242
- email = models.EmailField(_("E-Mail"), blank=True) # ,null=True)
243
- url = models.URLField(_("URL"), blank=True)
244
- phone = models.CharField(_("Phone"), max_length=200, blank=True)
245
- gsm = models.CharField(_("GSM"), max_length=200, blank=True)
246
- fax = models.CharField(_("Fax"), max_length=200, blank=True)
247
-
248
- def send_mail(self, subject, message, from_email=None):
249
- "Sends an e-mail to this User."
250
- from django.core.mail import send_mail
251
-
252
- send_mail(subject, message, from_email, [self.email])
253
-
254
-
255
- class Contacts(dd.Table):
256
- model = Contact
257
- # ~ column_names = '*'
258
- detail_layout = """
259
- person company role
260
- email url
261
- phone gsm fax
262
- """
263
-
264
-
265
- class ContactsByPerson(Contacts):
266
- master_key = "person"
267
- column_names = "email url phone gsm fax company role *"
268
-
269
-
270
- class ContactsByCompany(Contacts):
271
- master_key = "company"
272
- column_names = "email url phone gsm fax person role *"
273
-
274
-
275
- # ~ class User(Person):
276
- class User(Contact):
277
- preferred_foreignkey_width = 15
278
-
279
- class Meta:
280
- verbose_name = _("User")
281
- verbose_name_plural = _("Users")
282
-
283
- username = models.CharField(
284
- _("username"),
285
- max_length=30,
286
- unique=True,
287
- help_text=_(
288
- """
289
- Required. 30 characters or fewer.
290
- Letters, numbers and @/./+/-/_ characters
291
- """
292
- ),
293
- )
294
- is_staff = models.BooleanField(
295
- _("is staff"),
296
- default=False,
297
- help_text=_(
298
- """
299
- Designates whether the user can log into this admin site.
300
- """
301
- ),
302
- )
303
- is_expert = models.BooleanField(
304
- _("is expert"),
305
- default=False,
306
- help_text=_(
307
- """
308
- Designates whether this user has access to functions that require expert rights.
309
- """
310
- ),
311
- )
312
- is_active = models.BooleanField(
313
- _("is active"),
314
- default=True,
315
- help_text=_(
316
- """
317
- Designates whether this user should be treated as active.
318
- Unselect this instead of deleting accounts.
319
- """
320
- ),
321
- )
322
- is_superuser = models.BooleanField(
323
- _("is superuser"),
324
- default=False,
325
- help_text=_(
326
- """
327
- Designates that this user has all permissions without
328
- explicitly assigning them.
329
- """
330
- ),
331
- )
332
- last_login = models.DateTimeField(_("last login"), default=timezone.now)
333
- date_joined = models.DateTimeField(_("date joined"), default=timezone.now)
334
-
335
- def __unicode__(self):
336
- return self.username
337
-
338
- def full_clean(self, *args, **kw):
339
- if not self.username and self.person:
340
- self.username = self.person.first_name.lower()
341
- super(User, self).full_clean(*args, **kw)
342
-
343
-
344
- class Users(Contacts):
345
- model = User
346
- column_names = "username person company is_superuser is_staff *"
347
-
348
-
349
- if settings.SITE.is_installed("contacts"):
350
- """
351
- Don't inject fields if contacts is just being imported from some other module.
352
- """
353
-
354
- from lino.models import SiteConfig
355
-
356
- dd.inject_field(
357
- SiteConfig,
358
- "site_company",
359
- dd.ForeignKey(
360
- Company,
361
- blank=True,
362
- null=True,
363
- verbose_name=_("The company that runs this site"),
364
- related_name="site_company_sites",
365
- ),
366
- """The Company to be used as sender in documents.""",
367
- )
368
-
369
- NAME = "contacts"
370
- LABEL = _("Contacts")
371
-
372
-
373
- def setup_main_menu(config, site, user_type, m, ar=None):
374
- m.add_action(Companies)
375
- m.add_action(Persons)
376
- # ~ m.add_action(Contacts)
377
-
378
-
379
- def setup_my_menu(config, site, user_type, m, ar=None):
380
- pass
381
-
382
-
383
- def setup_config_menu(config, site, user_type, m, ar=None):
384
- # ~ m = m.add_menu(NAME,LABEL)
385
- # ~ m.add_action(AddressTypes)
386
- m.add_action(Roles)
387
- m.add_action(site.modules.countries.Countries)
388
- m.add_action(site.modules.countries.Cities)
389
-
390
-
391
- def setup_explorer_menu(config, site, user_type, m, ar=None):
392
- # ~ m = m.add_menu(NAME,LABEL)
393
- m.add_action(Contacts)
394
- if not settings.SITE.abstract_address:
395
- m.add_action(Addresses)
@@ -1,67 +0,0 @@
1
- from lino.projects.std.settings import *
2
-
3
-
4
- class Site(Site):
5
- user_model = "contacts.User"
6
- # ~ use_contenttypes = False
7
-
8
- abstract_address = True
9
- """
10
- If True, then the Addresses model is abstract
11
- (i.e. we don't have a separate table for Addresses).
12
- After changing this setting, you must rebuild the database.
13
- """
14
-
15
- def setup_quicklinks(self, user, tb):
16
- super(Site, self).setup_quicklinks(user, tb)
17
- tb.add_action(self.modules.contacts.Persons.detail_action)
18
- tb.add_action(self.modules.contacts.Companies.detail_action)
19
-
20
- def setup_menu(self, user_type, main, ar=None):
21
- from django.utils.translation import gettext_lazy as _
22
- from django.db import models
23
-
24
- def doit(methodname, *args):
25
- for a in models.get_apps():
26
- meth = getattr(a, methodname, None)
27
- if meth is not None:
28
- meth(*args)
29
-
30
- m = main.add_menu("master", _("Master"))
31
- doit("setup_main_menu", self, ui, user_type, m)
32
-
33
- m = main.add_menu("config", _("Configure"))
34
- doit("setup_config_menu", self, ui, user_type, m)
35
-
36
- m = main.add_menu("explorer", _("Explorer"))
37
- doit("setup_explorer_menu", self, ui, user_type, m)
38
-
39
- m = main.add_menu("site", _("Site"))
40
- doit("setup_site_menu", self, ui, user_type, m)
41
-
42
-
43
- SITE = Site(globals())
44
-
45
- INSTALLED_APPS = (
46
- # ~ 'django.contrib.contenttypes',
47
- "lino_xl.lib.countries",
48
- "lino",
49
- "lino.sandbox.contacts",
50
- )
51
-
52
- import datetime
53
-
54
- filename = settings.SITE.today().strftime("%Y-%m-%d.log")
55
- LOGGING = dict(filename=join(LINO.project_dir, "log", filename), level="DEBUG")
56
-
57
- DEBUG = True
58
-
59
- DATABASES = {
60
- "default": {
61
- "ENGINE": "django.db.backends.sqlite3",
62
- "NAME": join(LINO.project_dir, "test.db"),
63
- # ~ 'NAME': ':memory:'
64
- }
65
- }
66
- # uncomment for testing in temporary database:
67
- # ~ DATABASES['default']['NAME'] = ':memory:'
@@ -1,65 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- ============================================================================================================
3
- * File Name : RetrieveTIGroups.wsdl
4
- * Author : Davy Tielens
5
- * Owner : CBSS
6
- * Creation date : 29-04-10
7
- * Last revision date : 09/03/2011
8
- * Status : Planned
9
- * Description : WSDL for webservice enabling the PCSA's to fetch TI's from the NR
10
- * Current version : 0.2
11
- * Revision History : 0.1 - 29-04-10 - DTI - Initial version
12
- 0.2 - 29-07-10 - MDS - Completion of first version of WSDL
13
- 0.3 09/03/2011 ATI change schema RRN 2009 vs 2011
14
- 0.4 17/11/2011 ATI change schema RRN 201104 vs 20103
15
- ============================================================================================================= -->
16
- <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://kszbcss.fgov.be/intf/RetrieveTIGroupsService/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="RetrieveTIGroupsService" targetNamespace="http://kszbcss.fgov.be/intf/RetrieveTIGroupsService/v1">
17
- <wsdl:types>
18
- <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" xmlns:rtg="http://kszbcss.fgov.be/types/RetrieveTIGroups/v1" targetNamespace="http://kszbcss.fgov.be/intf/RetrieveTIGroupsService/v1">
19
- <xsd:import namespace="http://kszbcss.fgov.be/types/RetrieveTIGroups/v1" schemaLocation="RetrieveTIGroupsV3.xsd"/>
20
- <xsd:element name="retrieveTIGroupsRequest" type="rtg:RetrieveTIGroupsRequestType"/>
21
- <xsd:element name="retrieveTIGroupsResponse" type="rtg:RetrieveTIGroupsResponseType"/>
22
- <xsd:element name="retrieveTIGroupsFault" type="rtg:RetrieveTIGroupsFaultType"/>
23
- </xsd:schema>
24
- </wsdl:types>
25
- <wsdl:message name="retrieveTIGroupsRequestMsg">
26
- <wsdl:part element="tns:retrieveTIGroupsRequest" name="retrieveTIGroupsRequestParameters"/>
27
- </wsdl:message>
28
- <wsdl:message name="retrieveTIGroupsResponseMsg">
29
- <wsdl:part element="tns:retrieveTIGroupsResponse" name="retrieveTIGroupsResponseParameters"/>
30
- </wsdl:message>
31
- <wsdl:message name="retrieveTIGroupsFaultMsg">
32
- <wsdl:part element="tns:retrieveTIGroupsFault" name="retrieveTIGroupsFaultParameters"/>
33
- </wsdl:message>
34
- <wsdl:portType name="RetrieveTIGroupsPortType">
35
- <wsdl:operation name="retrieveTI">
36
- <wsdl:input message="tns:retrieveTIGroupsRequestMsg" name="retrieveTIGroupsRequest"/>
37
- <wsdl:output message="tns:retrieveTIGroupsResponseMsg" name="retrieveTIGroupsResponse"/>
38
- <wsdl:fault message="tns:retrieveTIGroupsFaultMsg" name="retrieveTIGroupsFault"/>
39
- </wsdl:operation>
40
- </wsdl:portType>
41
- <wsdl:binding name="RetrieveTIGroupsServiceHTTPBinding" type="tns:RetrieveTIGroupsPortType">
42
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
43
- <wsdl:operation name="retrieveTI">
44
- <soap:operation soapAction="http://kszbcss.fgov.be/RetrieveTIGroupsService/retrieveTI"/>
45
- <wsdl:input name="retrieveTIGroupsRequest">
46
- <soap:body use="literal"/>
47
- </wsdl:input>
48
- <wsdl:output name="retrieveTIGroupsResponse">
49
- <soap:body use="literal"/>
50
- </wsdl:output>
51
- <wsdl:fault name="retrieveTIGroupsFault">
52
- <soap:fault name="retrieveTIGroupsFault" use="literal"/>
53
- </wsdl:fault>
54
- </wsdl:operation>
55
- </wsdl:binding>
56
- <wsdl:service name="RetrieveTIGroupsService">
57
- <wsdl:port binding="tns:RetrieveTIGroupsServiceHTTPBinding" name="RetrieveTIGroupsService">
58
- <!-- soap:address location -->
59
- <!--dvlp : bcssksz-services-test.smals.be -->
60
- <!--acpt:bcssksz-services-acc.smals.be -->
61
- <!-- prod:bcssksz-servicesprod.smals.be-->
62
- <soap:address location="https:// bcssksz-services-test.smals.be:443/SOA4520/RetrieveTIGroupsService/retrieveTI"/>
63
- </wsdl:port>
64
- </wsdl:service>
65
- </wsdl:definitions>