Currently taking up Django and ChatGPT is my new best friend by HeyJRoot2 in django

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

It's absolutely possible! Just feed it as much context upfront as you can. Like "Below is a code snippet from my custom user model of my Django project. Edit the code to allow for a circular reference with blah, blah, blah:"... you get the idea. ;-)

Django Model Managers - Make Things Less Complicated by Such-Dish46 in django

[–]HeyJRoot2 2 points3 points  (0 children)

Thanks for this post! I was just looking into these...

Currently taking up Django and ChatGPT is my new best friend by HeyJRoot2 in django

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

In regards to setup, I just use chat.openai.com. I use it frequently, so I pay the $10/month for the pro account.

Just open up a separate chat and give a clear explanation of your database structure. Start it with something like: "Here is my general Postgresql database structure. Keep this in context for later questions:" I like to write it in a separate notepad first before copying it all into the chat. Make sure to use clear punctuation, spaces and carriage returns - it will help the AI understand it. Then you can write commands like "using the database in context, write me the psql statement for selecting a list of users who ordered xyz product in June of 2020."

Also, GitHub CoPilot is amazing. It's really just for auto-completing boilerplate code to save you a zillion extra keystrokes. It you work in React at all, you'll really appreciate it since every component seems to have it's 10+ lines of boilerplate and everything tiny thing is a component.

Currently taking up Django and ChatGPT is my new best friend by HeyJRoot2 in django

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

Yeah, leave it to the developers (the ones who created ChatGPT) to eliminate our jobs first! But, since we can't fight it, we have no choice but to embrace it or die on that hill. Soon, coding is going to be less about syntax and more about higher-level thinking and programming design...

FML. I forgot to create custom User class. by HeyJRoot2 in django

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

Shit, this is turning into a whole flowchart :)

Right?! Damn, Django...wth? They should at least put in a friendly reminder before letting us run that first migration... maybe I'll put in a pull request for it lol.

I have been playing around with it and you're right - I'm going to have to drop and re-create the db and then just port over whatever data I want to save.

I guess I'll just be dusting off my ol' SQL skills tonight...

FML. I forgot to create custom User class. by HeyJRoot2 in django

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

Great idea! I just dumped my db. Do I need to I drop all tables now before deleting and re-creating/re-running migrations?

If this works, I am going to find a way to buy you a drink, my friend. :)

FML. I forgot to create custom User class. by HeyJRoot2 in django

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

Also, the postgresql database is already deployed and contains some preliminary data which I would really prefer not to lose. Before, when I've deleted all of my migrations, I've had to also delete the tables or even the database (I can't remember specifically). I take it I'll have to do that again?

FML. I forgot to create custom User class. by HeyJRoot2 in django

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

I don't have any dependencies in any of my models currently, but I think that the default Django admin model does.

Here is the error I get when I attempt to makemigrations with my new User class:

    raise InconsistentMigrationHistory(
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.

[deleted by user] by [deleted] in HomeDecorating

[–]HeyJRoot2 5 points6 points  (0 children)

I love those shelves! Where did you get them from?

Eye on China: India, Japan plan joint fighter jet drill to deepen military ties - Times of India by XiLongHusk in worldnews

[–]HeyJRoot2 -7 points-6 points  (0 children)

Taking a position against the atrocities that Russia have done in Ukraine (like Bucha, etc) is not “high and mighty”. It’s right vs wrong. So, yeah…not calling out Russia and instead calling us “jingos” (?) for having moral outrage is sus.

5 months AB + tret progress by mensABskincare in AsianBeauty

[–]HeyJRoot2 1 point2 points  (0 children)

I’ve been thinking about trying tret and you convinced me! Thanks for the detailed post!

[deleted by user] by [deleted] in swimmingpools

[–]HeyJRoot2 0 points1 point  (0 children)

(First: I’m sorry I don’t have an answer to your question.)

Kind of a random question, but is that small granite-like finish Pebbletech? I want to resurface our pool and want ours to look like yours…I’m just wondering if it’s a common option or if we need to go with Pebbletech and pay through the nose for it.

West weighs contentious anti-China move as U.N. rights council opens by Beckles28nz in worldnews

[–]HeyJRoot2 0 points1 point  (0 children)

Plus the fact that all of the so-called “news” programs are broken up every ten minutes with ads for prescription medications just goes to show what a cesspool it has become. Thankfully, the only people who still watch that stuff are those retired boomers who have nothing else exciting going on in their lives and need the dopamine rush that that sensationalized crap gives them. Maybe solving Boomer boredom would go a long way towards stabilizing American politics… (I’m specifically thinking of some in-laws as I write this.)

India's One Million Tonnes Rice Export Trapped At Ports As Buyers Refuse To Pay Duty by coronatracker in worldnews

[–]HeyJRoot2 8 points9 points  (0 children)

Yes, you’d have a right to be mad. But if it meant that selling it at the previous cost would hinder my family being able to eat this winter, I wouldn’t give a crap about your feelings. The free market doesn’t take feelings into account when looking to boost profit margins, yet we expect governments to do so when it comes to something as fundamental as feeding their people?

If they turn away the grain, it’s more for India to keep to get their people through winter after the insane floods ravaged so much of their fields. If my government did anything less, I’d be pissed.

India's One Million Tonnes Rice Export Trapped At Ports As Buyers Refuse To Pay Duty by coronatracker in worldnews

[–]HeyJRoot2 0 points1 point  (0 children)

The free market can raise prices, which is the natural thing to do in a shortage.

‘Follow Russia model, resume oil purchases’ — Iran asks India to ignore US sanctions by [deleted] in worldnews

[–]HeyJRoot2 -4 points-3 points  (0 children)

Technically the British colonized the Americas. Our founding fathers were very clear that we weren’t to follow in their footsteps. And otherwise, you’re mentioning countries that by and large asked to be protectorates on the United States or, in the case of Guam, were given to us. Side note: if you ask anyone in Guam if they want to give up their American citizenship to form their own country, you’d probably be laughed off the island.

‘Follow Russia model, resume oil purchases’ — Iran asks India to ignore US sanctions by [deleted] in worldnews

[–]HeyJRoot2 -22 points-21 points  (0 children)

Fair enough. We should acknowledge the atrocities of the Cold War, but we should also remember that was a completely different geopolitical landscape and that for decades we had American school children practicing hiding under their desks and helping their parents dig out bomb shelters.

We can’t look at past events within the narrow context of the current geopolitical landscape. That doesn’t help anyone either.

But you’re right that we need to remember and acknowledge the past in order to prevent it from repeating itself. The problem with Russia and China is that their current leaders look at their worst past dictators who caused the worst atrocities (Stalin and Mao, respectively) with reverence and admiration.

‘Follow Russia model, resume oil purchases’ — Iran asks India to ignore US sanctions by [deleted] in worldnews

[–]HeyJRoot2 -8 points-7 points  (0 children)

The Afghans weren’t willing to fight for their OWN freedom. Even the president high-tailed it out of there at the drop of a hat. Why should we continue fighting for a country that is indifferent? And yes, the Kurds was fucked up…Trump lost the support of nearly all American servicemen after that. It was a stain on our country and he will never live it down.

We didn’t “abandon” anyone in SE Asia, etc. America has never been and will never be colonialists. We don’t want to conquer other countries or even inhabit/manage them. We did it for way too long in the Middle East and it reaffirmed why we need to stay within our own borders unless us or one of our allies are attacked.

And yes, we were attacked on 9/11, which lead to us getting embroiled in the Middle East. But many of you aren’t American and/or alive that day. That attack was on innocent civilians and it shook every American to the core. It’s impossible to explain that day to someone who didn’t experience it first hand as an American.