# Working with a class that imports modules?

**URL:** <https://forum.inductiveautomation.com/t/working-with-a-class-that-imports-modules/43236>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 10, 2021, 2:15pm UTC](https://forum.inductiveautomation.com/t/working-with-a-class-that-imports-modules/43236 "2021-02-10T14:15:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![chasondeshotel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/chasondeshotel/32/20032_2.png) [@chasondeshotel](https://forum.inductiveautomation.com/u/chasondeshotel)\
**Post date:** [February 10, 2021, 10:28pm UTC](https://forum.inductiveautomation.com/t/working-with-a-class-that-imports-modules/43236/8 "2021-02-10T22:28:53Z")

</div>

> Generally speaking, once I get my modules solidified and they aren’t updated - this should work fine otherwise in a production environment right?

Yes, but the downside is supreme annoyance during development vs the downside of using fully qualified names... which is they're ugly.

Another gotcha in Ignition's Python environment is that you have to catch Java exceptions too. A standard `try` `except` won't catch those. See: [Using Try/Except to Dummy Proof & Check if SQL Tables/Columns Exist - #4 by pturmel](http://forum.inductiveautomation.com/t/using-try-except-to-dummy-proof-check-if-sql-tables-columns-exist/26140/4)

> My entire application is just all GUI forms and they all go through the same or very similar process, so I am trying hard to abstract the common processes away.

That's the crux of the DRY principle, innit?

Anyway this is the real cringe 😅

```auto
		if userId is None:
			self.userId = self.form_payload['userId']
                else:
                        self.userId = userId

```

when you could

```auto
self.userId = userId or self.form_payload['userId']

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/working-with-a-class-that-imports-modules/43236)._
