Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:57:41+00:00 2026-05-31T10:57:41+00:00

The problem specifically is that I can create the type of data found in

  • 0

The problem specifically is that I can create the type of data found in the Django database using python, is that the model I have Django, there BigIntegerField, IntegerField and DecimalField but I can not make the same kind of data using python, the idea is to make my python code automatically update the database, here the code:

Django Model

unidad = models.BigIntegerField(max_length=15)
pin = models.IntegerField(max_length=2)
fecha = models.DecimalField(max_digits=7,decimal_places=1)

Python execute

cursor.execute('''create table u_%(table_name)s stocks (id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,id_unidad bigint NOT NULL, pin integer NOT NULL, fecha numeric(7, 1) NOT NULL)''' % dict(table_name = table_name))

This is the output of Django when I run “python manage.py sql gprs”

BEGIN;
CREATE TABLE `evento` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `unidad` bigint NOT NULL,
    `pin` integer NOT NULL,
    `fecha` numeric(7, 1) NOT NULL
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:57:42+00:00Added an answer on May 31, 2026 at 10:57 am

    Your question is kind of confusing. To see the actual sql that django uses to create your model prior to executing python manage.py syncdb, you can use python manage.py sql appname as documented here:
    https://docs.djangoproject.com/en/dev/ref/django-admin/#sql-appname-appname

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have an address field from an Access database which has been converted
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Specifically, I have a number of pages in my Rails app that use the
I have the following Execution statement which creates a table (using data from another
I tried to create a container for posible metadata that can be attached to
I am wondering how you would approach this problem I have two Taxrates that
Here is the problem I'm running into. There's a huge legacy application that runs
I've been experimenting with ASP.Net MVC, and have come across a problem that is
Is there any way that you may create a puzzle of three pieces with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.