This commit is contained in:
@@ -11,6 +11,11 @@ import psycopg2
|
||||
import random
|
||||
import mimetypes
|
||||
|
||||
class RandomSimpsonsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.random_simpsons'
|
||||
label = 'simpsons'
|
||||
|
||||
def DB_generation(host_in,port_in,user_in,password_in,db_in):
|
||||
#db = pymysql.connect(host=host_in, port=port_in, user=user_in, passwd=password_in,db=db_in)
|
||||
db = psycopg2.connect(host=host_in, port=port_in, user=user_in, password=password_in,database=db_in)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 4.2.29 on 2026-06-11 19:50
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SimpsonsData',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('season', models.IntegerField()),
|
||||
('episode', models.IntegerField()),
|
||||
('url', models.CharField(max_length=100)),
|
||||
('seen', models.CharField(max_length=100)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'simpsons',
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.29 on 2026-06-11 20:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('simpsons', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='simpsonsdata',
|
||||
name='seen',
|
||||
field=models.BooleanField(),
|
||||
),
|
||||
]
|
||||
@@ -1,3 +1,10 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class SimpsonsData(models.Model):
|
||||
season = models.IntegerField()
|
||||
episode = models.IntegerField()
|
||||
url = models.CharField(max_length=100)
|
||||
seen = models.BooleanField()
|
||||
|
||||
class Meta:
|
||||
db_table = 'simpsons'
|
||||
Reference in New Issue
Block a user