Boostrap 5 migration

130 views
Skip to first unread message

yush...@gmail.com

unread,
Nov 21, 2022, 12:21:24 PM11/21/22
to Jam.py Users Mailing List
Hello,

I have finished Jam.py migration to Bootstrap 5.

You can download the package from this link:
https://drive.google.com/file/d/1-JxPb4Sx9pdTP0k0ON6toNJkwNNXHw3G/view?usp=share_link
or on the develop branch on github.

The migration required a lot of changes.
If you have any comments or suggestions or you find bugs,
Please let me know.

You should not use the new version for development just yet.
The next step is support for mobile devices.
And then documenting the changes and testing.

Regards,
Andrew Yushev

Danijel Kaurin

unread,
Nov 22, 2022, 3:19:44 AM11/22/22
to yush...@gmail.com, Jam.py Users Mailing List
Hi Andrew and thank you.

I'm on testing it in next days.

Regards

--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jam-py/54440f24-eef3-4fec-9110-4ea3bfd14511n%40googlegroups.com.

Ali

unread,
Nov 22, 2022, 11:12:10 AM11/22/22
to Jam.py Users Mailing List
Hi Andrew!

Looking forward to this, excellent work.  I've got a copy of the demo application to test it out.

I notice that details views are working completely differently in this version compared to v5 with no master_rec_id/master_id - I assume that instead you create a look-up as foreign key on the primary key of the potential parent table instead?  That definitely seems to get them visible with the Details button to be associated with a catalog/journal but I'm not sure if I'm missing something...?

I'm struggling to add Details to Catalogs/Journals themselves, I can selecting them with the Details button, when I go into the View Form/Edit Form dialogs and select the Details I want to include, they show up in the picker but then don't show up in the form config and don't end up in the front-end.  Is it that I'm screwing up the way I'm creating details?

Selecting Details against Item.png

View Form - picking Details.png

View Form - Details not being selected.png


Also, while creating the details view in the demo application there is a table called 'Temp' being created in demo.sqlite when updating items and if they fail for any reason, the Temp table remains and then subsequent efforts to update any items in the Builder result in an error that 'Temp' already exists.  I've had to go into demo.sqlite and drop the 'Temp' table a couple of times.

Cheers,
Ali

Andrew Yushev

unread,
Nov 22, 2022, 1:25:53 PM11/22/22
to Ali, Jam.py Users Mailing List
Hello,

Thank you!

Ali, there are now special kinds of details.
You can create a detail for any item if it is linked with a master by a lookup field.
Please see below.

Below are major changes in v7. 

There are now permissions for fields. You can declare some fields as hidden or read only for a role.
Hidden fields are not available on the client and couldn't be changed by the user with this role from the browser.
Read only fields are disabled in the browser and if changed won't be saved on the server.

There won't be details as a special type. Any item can be a detail of the other if they are linked by a lookup field.
For example, invoices can be a detail of customers because invoices have the customer lookup field whose lookup item is customers.
This way you don't need to write the code to make an invoice_table a detail of tracks as in the current demo.
There are calculated fields that are also based on lookup fields.
For example, you can have a field that will display the number of sold tracks of the tracks record without writing code.
The unlimited level of nested details is supported.

Reading and writing of the data are changed.
The on_open and on_apply events are deprecated.
Instead of them on_before_open,  on_after_open and on_before_apply_record, on_after_apply_record events are introduced.

The on_before_open event is triggered before the sql request is executed and can be used to validate the request and
add additional filters,  on_after_open is triggered after the sql request is executed and has a dataset as a parameter
that can be modified before it is sent to the client.

The on_before_apply_record is triggered before the sql query to save the record changes to the database table is executed
and can be used for data validation and calculations almost in the same way as it is done on the client now.
The on_after_apply_record is triggered after the sql query to save the record changes is executed and the primary key field is set
and can be used to perform other additional changes to the database in the same connection.
After the data is saved the delta is sent to the client and all changes made to it on the server are updated on the client.

Changes to a record that have details are processed on the server the following way:
First the on_before_apply_record event of the master is triggered, then
for each detail that has been changed the on_before_apply_record event is triggered
then that event is triggered for sub detail changes and so on.
After that in the reverse order the on_after_apply_record events are triggered for sub details, details and master.
That is true even if changes were made to the detail only.
That is the changes to the document (record and its details) are saved as a hole.

The code that works with database data is rewritten. For MSSQL and MYSQL alternative drivers are supported.
The text field size can be changed for databases that have text fields with a specified length.
If the new size is bigger, the length of the field is changed, otherwise, the field length remains the same but
the app checks that the length text is less than the size value.

The edit and post methods when charging a record can be omitted. They are implemented internally.  

In App builder copies (clones) of items could be created.
It is possible to move items to other groups.

The concept of Jam.py is now as follows:
You can use Jam.py for the development of interface loaded applications.
These applications can be developed in the same way as desktop applications,
regardless of the availability of code on the client (in the browser debugger).
This is possible due to the full control over what data the user on the client can access and
what changes he can make to the data that can be implemented on the server.
This control is available due to setting roles to the elements and fields of the project and
very simple way of implementing restrictions with the server event handlers.

Drazen D. Babic

unread,
Nov 22, 2022, 8:58:25 PM11/22/22
to Jam.py Users Mailing List
Andrew,

maybe we can all start using some sort of list, with the issues found. So it's easy to read and no need to duplicate findings by others.
Years ago Trello was created and it was great. Not sure which product is good this days.

D.



Danijel Kaurin

unread,
Nov 23, 2022, 12:52:21 PM11/23/22
to Drazen D. Babic, Andrew Yushev, Jam.py Users Mailing List
Hi Dražen,

I propose tu use github issues, that's easiest way.

@Andrew Yushev can you searh on details for every column? Now, search fields are more practical and they are needed on details to. Developer can disable them with jquery later if that is necessary. What you think?

Regards



--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.

Danijel Kaurin

unread,
Nov 23, 2022, 1:08:00 PM11/23/22
to Drazen D. Babic, Andrew Yushev, Jam.py Users Mailing List
I have error when installing this package (Windows 10). Version 7.0.2. was ok.

Traceback (most recent call last):
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
    yield saved
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 278, in run
    return func()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 46, in _execfile
    code = compile(script, filename, 'exec')
  File "C:\Users\Zbook\AppData\Local\Temp\easy_install-5rjan9fk\SQLAlchemy-2.0.0b3\setup.py", line 1
    from __future__ import annotations
SyntaxError: future feature annotations is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    'Topic :: Database :: Front-Ends'
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\install.py", line 117, in do_egg_install
    cmd.run()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 410, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 646, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 697, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 742, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\pkg_resources\__init__.py", line 850, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\pkg_resources\__init__.py", line 1122, in best_match
    return self.obtain(req, installer)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\pkg_resources\__init__.py", line 1134, in obtain
    return installer(requirement)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 695, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 876, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 1115, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\command\easy_install.py", line 1101, in run_setup
    run_setup(setup_script, args)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 251, in run_setup
    raise
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 100, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 100, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 169, in save_modules
    saved_exc.resume()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 144, in resume
    six.reraise(type, exc, self._tb)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 157, in save_modules
    yield saved
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 198, in setup_context
    yield
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 248, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 278, in run
    return func()
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 246, in runner
    _execfile(setup_script, ns)
  File "C:\Users\Zbook\AppData\Local\Programs\Python\Python36\lib\site-packages\setuptools\sandbox.py", line 46, in _execfile
    code = compile(script, filename, 'exec')
SyntaxError: future feature annotations is not defined

Andrew Yushev

unread,
Nov 23, 2022, 3:33:57 PM11/23/22
to Danijel Kaurin, Drazen D. Babic, Jam.py Users Mailing List
Danijel, I forgot to mention that the Python version must be 3.7 or higher.
See
python_requires = '>= 3.7'
in setup.py

As for searching in details, it is possible now.

ср, 23 нояб. 2022 г. в 21:07, Danijel Kaurin <yonika...@gmail.com>:

Drazen D. Babic

unread,
Nov 23, 2022, 11:31:54 PM11/23/22
to Jam.py Users Mailing List
Well, 
the simple App created and exported and Import does not work... "deleteing" is not english word.
INFO - Import: checking data integrity
INFO - Import: analyzing changes
ERROR - 'NoneType' object is not subscriptable

Traceback (most recent call last):
 .
.   self.fields = changes['fields']
TypeError: 'NoneType' object is not subscriptable
INFO - The metadata have not been imported

Drazen D. Babic

unread,
Nov 23, 2022, 11:40:32 PM11/23/22
to Jam.py Users Mailing List
Screenshot from 2022-11-24 12-32-42.png

I'm sorry, too many issues for general public. 

Ali

unread,
Nov 24, 2022, 4:49:20 AM11/24/22
to Jam.py Users Mailing List
HI Andrew,

It's definitely a big change - so if I want to include tables as tabbed 'details' like in v5, how do I do that in v7?  Is it possible with the Builder UI?  I've just spun up a fresh test project, I've created a 'courses' table and a 'course versions' table, with a lookup from 'course versions' to 'courses' on the 'course' field, I've selected 'course versions' with the Details button on 'courses', and I wish to create a 'details' view of 'course versions' and the issue as above means I can't do that from the UI.  Is it a bug or am I missing something?

Also, the JOIN, are you still implementing the concept of pick any field to create the join, the value will be the ID and the lookup_value will be the field you picked in the foreign table?  Or should we explicitly creating JOINs (lookups) on Record ID now, hiding it, and including all the fields we want as additional lookups with Master fields?

In terms of giving the new version a proper test and thinking about migration, this is the key thing I'm struggling with.

Thank you!
Ali

Andrew Yushev

unread,
Nov 24, 2022, 4:15:18 PM11/24/22
to Ali, Jam.py Users Mailing List
Hi, Ali

Old existing details are supported.
To add an item as a detail to a master add to detail a lookup field whose lookup item is a master.

image.png

This is a much simpler way. 
if you have lookup fields you can create master detail relationships without any code.
See Tracks in the demo app. The master detail relationship is set without a line of code.
Besides you can add to detail fields from master as invoice_date in the picture above.

As for JOINs, unfortunately I don't understand what you mean.

Regards,
Andrew

чт, 24 нояб. 2022 г. в 12:49, Ali <xad...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.

Alistair Bates

unread,
Nov 24, 2022, 4:55:16 PM11/24/22
to Andrew Yushev, Jam.py Users Mailing List
Hi Andrew

I’m trying to add details table to a view form or an edit form in exactly the same way as v5. I cannot in v7.0.3.

The Builder UI does not let me select the details in View Form settings - I double-click or tick and close and they do not show in the lookup box as per my third screenshot, so they do not show up in the front end. So I cannot add any details to any masters in v7.0.3 at all. 

To reproduce, create new project with v7, create two tables, one with lookup on other, try to add details on master in View Form options in Builder UI, the details show up in the lookup as per screenshot 2, but double-clicking or selecting and closing does not return them to View Form options screen shown in screenshot 3. 

Maybe it’s a bug in the Builder with v7.0.3?

Thanks,
Ali

Drazen D. Babic

unread,
Nov 24, 2022, 8:44:53 PM11/24/22
to Jam.py Users Mailing List
Here is the video, it does not work on any project, including Demo:


Details_v7.mp4

Drazen D. Babic

unread,
Nov 24, 2022, 8:54:30 PM11/24/22
to Jam.py Users Mailing List
Actually, any selection does not work, including Search, Sorting, etc

As mentioned, we need a list with ALL issues, this could be reported on the first day. 
Github does not cut it, since 2FA is needed.
Thanks

Sorting_v7.mp4

Drazen D. Babic

unread,
Nov 24, 2022, 9:09:14 PM11/24/22
to Jam.py Users Mailing List
Moving table issue. Requires App restart  to get it back to Customers!

moving_v7.mp4
Reply all
Reply to author
Forward
0 new messages