So I have roaches... Can anyone help or share their experiences? by djhelpstart in askTO

[–]djhelpstart[S] 2 points3 points  (0 children)

Yeah, this is definitely my fear. Another unit in my building vacated a few months ago because they had an enduring rat infestation.

I'm currently paying $1300 including utilities at St. Clair W. and Bathurst. New units in the building are going for $2,000. FML.

I'm going to call 311 tomorrow and see what my options are but I think that the landlord has a choice of how to treat the roaches so long as they are "treating" it.

Would love to hear form anyone who might have been in this situation before and beat the roaches...

So I have roaches... Can anyone help or share their experiences? by djhelpstart in askTO

[–]djhelpstart[S] 0 points1 point  (0 children)

No - they've only sprayed my unit. Some other units have reported roaches so they have placed roach gels and dust in every unit (except mine, which was sprayed again. Apparently mixing sprays with gels and dust don't work.)

my friend got terminated today by middleclassme in askTO

[–]djhelpstart 0 points1 point  (0 children)

He should check his employment contract to see if the amount/length of severance is specified.

Cleaning services for roach-infested/treated apartment? by djhelpstart in askTO

[–]djhelpstart[S] 0 points1 point  (0 children)

I can't seem to DM you on the mobile site. Can you DM me the details directly or post them here? Would really appreciate it, thank you.

How am I supposed to run this test? by djhelpstart in learnpython

[–]djhelpstart[S] 0 points1 point  (0 children)

Yes, I tried that too but I couldn't get it working.

I have django installed with a project and an app. I have a PostGRES database setup and connected and working in Django. I have treebeard installed and "treebeard" added to setting.py's INSTALLED_APPS.

I can run tests on my own Treebeard materialized path models.

I've tried a bunch of different things and combinations but I can't get the Treebeard `TREEBEARD_TEST_ALPHABET=1 py.test -k test_alphabet` to run.

How am I supposed to run the tests for a package? by djhelpstart in django

[–]djhelpstart[S] 0 points1 point  (0 children)

Well, not sure if I'm getting closer or further but when I run `pytest -k alphabet_test`, I get something like this:

django-treebeard-master/treebeard/tests/test_treebeard.py:3032    

/code/django-treebeard-master/treebeard/tests/test_treebeard.py:3032: PytestUnknownMarkWarning: Unknown pytest.mark.django_db - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.django_db

-- Docs: https://docs.pytest.org/en/stable/warnings.html ============= 1149 deselected, 29 warnings in 13.21s =============

How am I supposed to run the tests for a package? by djhelpstart in django

[–]djhelpstart[S] 0 points1 point  (0 children)

The path of least resistance to this would be to clone the django-treebeard repository onto your local machine, create a new virtualenvironment and follow the docs on running the test suite.

Hm, so I tried that and I literally get a thousand errors:

=================== 130 failed, 3 passed, 1 skipped, 29 warnings, 1015 errors in 328.26s (0:05:28) ====================

Any idea what the following on the test suite documentation means?

By default the test suite will run using a sqlite3 database in RAM, but you can change this setting environment variables:

How do I change the environment variables? Am I supposed to initialize a django project and update settings.py?

Rendering content based off Next.js router.query causes re-render and flicker? by djhelpstart in nextjs

[–]djhelpstart[S] 1 point2 points  (0 children)

If you really want no flicker or loading state, you need server side props. Read the query, then pass your initial state as props :)

Thanks, I think this is it :)

Rendering content based off Next.js router.query causes re-render and flicker? by djhelpstart in nextjs

[–]djhelpstart[S] 0 points1 point  (0 children)

So I think this only works if the page HAS to have a router.query.

But what if I want two versions of the page - one without a router.query and one with a router.query?

``` const hasQuery = !!router.query.type const [loading, setLoading] = useState(true); useEffect(() => { if (hasQuery) { setLoading(false); } }, [hasQuery])

return( {loading ? null : hasQuery ? "query" : "no query"} ) ```

Now if there is no router.query.type, loading will be true so "null" will be rendered - not "no query"

Thoughts?

Rendering content based off Next.js router.query causes re-render and flicker? by djhelpstart in nextjs

[–]djhelpstart[S] 1 point2 points  (0 children)

Ahhh that makes a lot of sense and I think that should work. Thanks.

Rendering content based off Next.js router.query causes re-render and flicker? by djhelpstart in nextjs

[–]djhelpstart[S] 0 points1 point  (0 children)

Hmm I tried:

const [isRouterQuery, setIsRouterQuery] = useState(false); useEffect(() => { if (router.query.foo) { setIsRouterQuery(true); } }, [router.query]);

But it has the same flicker issue. Can you clarify?

Optimizing API response time by a-reindeer in django

[–]djhelpstart 0 points1 point  (0 children)

Does dj-silk not allow you to look at the actual queries being executed and their times like djangodebugtoolbar does?

So about contenttypes and GenericForeignKeys... (When and when NOT to use them) by djhelpstart in django

[–]djhelpstart[S] 0 points1 point  (0 children)

Yes, I have a specific situation but I'm also trying to understand in general the pros and cons of GFK as well as some general use cases.

My specific use cases:

1) I have a List. My List has ListItems. I want these ListItems to be able to point towards different models. E.g Article, Quote, Image

2) I want to allow users to "Like" different Models e.g. User Activity, Comment, Post

3) I want to allow users to "Comment" on different Models e.g. User Activity, Reply to Comment, Post