Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 03 22:32
    dill0wn ready_for_review #53
  • Feb 03 22:30
    dill0wn synchronize #53
  • Jan 29 23:21

    amol- on development

    disable logging and cleanup (compare)

  • Jan 29 23:11

    amol- on development

    Use development version of TG (compare)

  • Jan 29 21:08

    amol- on development

    Fix on Python 3.10 and 3.11 (compare)

  • Jan 29 20:58

    amol- on development

    Stop CI on first failure (compare)

  • Jan 29 17:17

    amol- on development

    Adapt to pytest (compare)

  • Jan 29 15:42

    amol- on development

    Fix generated app_cfg (compare)

  • Jan 29 15:40

    amol- on development

    Upgrading guides from 2.4 to 2.5 (compare)

  • Jan 29 15:29

    amol- on development

    Address some auth_backend lefto… (compare)

  • Jan 29 15:08

    amol- on development

    Switch test suite from nose to … (compare)

  • Jan 28 16:19

    amol- on development

    Further tweaks to make tests pa… (compare)

  • Jan 28 15:26

    amol- on development

    Temporarily need tempita unrele… (compare)

  • Jan 28 15:20

    amol- on development

    Tweak install process (compare)

  • Jan 28 15:17

    amol- on development

    Fix assertions and pip installs (compare)

  • Jan 28 14:57

    amol- on development

    Use development version of temp… (compare)

  • Jan 28 13:54

    amol- on development

    Initial attempt at modernizing … (compare)

  • Jan 25 15:38
    dill0wn synchronize #53
  • Jan 25 15:27
    dill0wn converted_to_draft #53
  • Jan 24 22:30
    dill0wn opened #53
Walter A. Boring IV
@hemna
the resulting html output adds a DOCTYPE as part of the include for webcam.xhtml
which it shouldn't
webcam.xhtml just is a tiny segment of html
how can I tell kajiki to not prepend <!DOCTYPE kajiki SYSTEM "kajiki.dtd"> to the contents of webcam.xhtml ?
Walter A. Boring IV
@hemna
I filed a defect
it includes sample template code and output, which seems broken
Alessandro Molina
@amol-
@hemna it's an hack, but have you tried renaming the included templates with .html instead of .xhtml? I suspect the loader might be triggering a DOCTYPE insertion due to html5 load mode.
include works fine in kajiki plain, so I suspect it's something about the loader configuration by TG that's causing that
Alessandro Molina
@amol-
Also, I usually do partials with py:import and py:def, it's usually a more reliable and well encapsulated way of making reusable snippets than just including the template content raw with py:include
Walter A. Boring IV
@hemna
I renamed the template files to html and then it failed to serve them
Alessandro Molina
@amol-
You changed the py:include expression to point to the new name, right?
Alessandro Molina
@amol-
@hemna Released a new version of Kajiki that should address your issue.
Walter A. Boring IV
@hemna
ok thank you. I just updated and the DOCTYPE tags seem to be gone :)
Nils Philippsen
@nphilipp
Hey everybody! Any idea how I could use a temporary PostgreSQL db for tests, like with the pytest-postgresql fixture which creates a temporary DB process just for tests? I'm struggling finding a way to insert this one's URL into TG's configuration for the tests, because the port number isn't known up-front.
Alessandro Molina
@amol-
When you call make_app you can pass options to replace those from .ini or app_cfg but I think the real hard part is that the setup fixture in tests relies on setup-app
Nils Philippsen
@nphilipp
Hmm. What do you think about creating a temporary INI file inheriting from test.ini (just like test.ini inherits development.ini) but overriding the sqlalchemy.url bit? I can't think of why it shouldn't work and it seems the least intrusive way to achieve it -- it's a real config file, so everything else should "just work" when pointed at it.
Nilesh Govindrajan
@nileshgr

Hello folks

How do I define a hidden field dynamically whose name is controlled via a config parameter?

the name of the field itself is static
Alessandro Molina
@amol-
@nileshgr I think you can just pass a name = to the field itself. But I'm not sure what you would refer to as the name. Because there is also an id and a key.
The key in practice defines "in which parameter you find the value for that widget"
so I'm not sure if maybe you are thinkingo f that one
Nilesh Govindrajan
@nileshgr
@amol- basically I want to define the field name dynamically based on the value of tg.config['csrf.token_name']
Using the prepare method of twf.Form I am able to set the value of the HiddenField to csrf_token value available in tg.request, provided a field with name tg.config['csrf.token_name'] exists in the form
tyoc213 (David L)
@tyoc213

Hi there, I have a gived a turbogears project that is tied to python 2.7, if I wanted to upgrade to 3.8 which steps should I take?

Or it is better to start with a fresh TG project and start copying things there?

samjustice
@samjustice
I've done that recently (well a year ago so it's not super fresh). Mostly it's not too bad. There are some tools that can automate a lot of it like converting print to print(). Then run unit tests and see what breaks. Or curse the devs that didn't write unit tests and start running it and see what breaks. Really just follow guidelines for upgrading any project from 2.7 to 3.x
Alessandro Molina
@amol-
@tyoc213 usually porting TG projects should be fairly easy, TG itself takes care of most of the idiosyncrasies of Py2VSPy3 and to you everything is still exposed as it was. You might have to change some iterations etc, but mostly porting the existing codebase should be fairly quick.
tyoc213 (David L)
@tyoc213
@samjustice you mean I jsut need to run 2to3 ?
@amol- The main problem I have now are the dependencies, for example, Mysql-some doesnt exist for python 3... I just created a tg with python 3 and they use sql alchemy... and it seem that I doesnt need mysql headers anymore (like with the version 2.7)
so I think, I will start copying things from the old tg python 2.7 project to this one, piece by piece. Or maybe I should just overwrite old requeriments with new one?? :s
HoneySong
@HoneySongJ
Hi there, I'm looking for a way to updated data in realtime.Is there any way to update in real time?
Alessandro Molina
@amol-
@HoneySongJ I think ServerSentEvents are probably the easiest solution to that problem.
See https://www.slideshare.net/__amol__/reactive-realtime-web-applications-with-turbogears2 it's a fairly old presentation but covers both SSE and SocketIO (I'm not sure gevent-socketio still works with newest gevent versions btw).
Moshe Malawach
@moshemalawach
Wasn't aware of that room !
Alessandro Molina
@amol-
It's promoted on the Github page of TG2, but many people don't yet know it exists :D
michael-goebel
@michael-goebel
Hi everyone! I am working with a team of other graduate students to update an existing python 2.7 TG 2.1.5 application to python 3.7 and the newest TG release. The codebase relies heavily on utilities from the Pylons Project (Pylons, PasteDeploy, WebError, WebOb, WebTest, and Waitress), some of which have been deprecated in python 3. Our application also utilizes Zope and Paste. The codebase was started in 2004, with incremental updates throughout the years, but in need of a larger overhaul now. Is it possible, and recommended, to use TG for all of the web framework functionalities? If so, are there any resources you would recommend to help in this process?
Alessandro Molina
@amol-

@michael-goebel From 2.1.5 it should be doable to upgrade up to 2.4
There are some big changes, but nothing that should require you to rewrite things from scratch apart maybe the usage of TW2 instead of TW1.

My suggestion is to read the upgrade guidelines version by version -> https://turbogears.readthedocs.io/en/development/reference/upgrading.html

You can try to excecute them all at once, which is more complex but faster or just upgrade one version at the time. From 2.1 to 2.2 and then to 2.3 and so on... Once you are on TG2.2 and TW2 the jump to newer versions should be more straightforward.

For example Kallithea recently moved from using Pylons to TG2.4 when they upgraded to PY3
It was a fairly interesting project but in the end very little of the controllers had to be changed, most of the work happened in setup code.
And if they have been able to move from Pylons (which in the end is even a different framework) to TG2.4 without major hiccups, I'd say moving from TG2.1 to TG2.4 should be totally doable :D
Amil Khan
@amilworks
Whats up everyone! Has anyone integrated Keycloak authentication into their TurboGears2 webapp? I can't get the OpenID implementation to work with Keycloak so I was wondering if anyone made their own plugin or can provide any advice on how to go about this. Thanks!
Vincenzo Castiglia
@CastixGitHub
Hello everyone, I'm looking for feedbacks on a possible switch to pytest of newly quickstarted projects: TurboGears/tg2devtools#20
Alessandro Molina
@amol-

@CastixGitHub note that PR includes some changes to quickstart that were already discussed in a previous PR: https://github.com/TurboGears/tg2devtools/pull/19/files

The setting up your version control system is definitely out of the scope of gearbox quickstart. It might go in a dedicated gearbox command like gearbox gitignore or things like that providing a good ignore file for TG projects. But doing git init is definitely out of the scope of both gearbox and tg.

Rafael de Albuquerque Ribeiro
@rafaelri
Hi everyone, I am porting the persistence code of a python application from mongoengine to ming but I couldn't figure out how to map a nested class using the imperative mode ( https://ming.readthedocs.io/en/latest/baselevel.html#ming-baselevel ). I was willing to map a class that had a nested collection of a different class.
Hassan Igbaria
@TechComet
editor password ?
1 hour to get manager password
Alessandro Molina
@amol-
@TechComet Maybe just look at your websetup/bootstrap.py ? :D
languitar
@languitar:matrix.semipol.de
[m]
Hi, is there a chance to use multi-document transactions with Ming?
Alessandro Molina
@amol-
There is an ongoing experimental branch.
but it's fairly complex to finish due to the conflicts between the pymongo session and ming session.
languitar
@languitar:matrix.semipol.de
[m]
ok, seems to be hard problem to find a Python MongoDB ODM with change tracking and support for multi-document transactions :/
baas-hans
@baas-hans
Afternoon, I have been going through tabs and tabs of resources looking for an answer, but I feel stupider than when I started (which was already a large amount). Is there something elusive about trying to switch on the Secure and HttpOnly flag for cookie based auth?
Edit: Just assume I know nothing (which is close to the truth) and point me to the harshest docs that definitely contain some crumb to follow.
Janice
@LovinglyDenied

Heyo, I have a small question about Ming:

For a project, I have used a circular (object to the same object) relationship, using the exact same syntax as the docs: https://ming.readthedocs.io/en/latest/userguide.html#relating-classes
However, I ran into an issue: Even tough the ForeignIDProperty updates immediately, both in Mongo and in Ming, the RelationProperty values do not, and linger with their old state for a while, causing a bug.
Is there something that I could be doing wrong that causes this? Alternatively, is there a function available I could call to update the RelationProperty values when I need to be sure they are consistent with their ForeignIDProperties?