-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org
iQEcBAEBCgAGBQJTPeH+AAoJELMiOgVOfjkQKOYIAJCCxvVieg+ApPLEAwwmfyYM
BrNAJUgal0cHRzeoQzZeIci11GQ9dFXJVgUS1ShZXN9FlQZ9DBd6DDojK+N+7SwC
H5HsgPcuHPGiypTrTmyvYYMVNcoVokHwAJmFlkFUV6VAg9bJ1i0m6HCYyf4TSPkJ
eD2dn6+wy2UeQjzMOn8W8Timse1KySeCFt8fjOSpdrcbuXX5Zb/cihK9WHJmCMJH
nS2gndQ54PsiKT1rSkuAQkx8ge4RrSJPG1gJkq6PzoD/FhTGwXnzSaL+ScR6CLeE
bp/KrRVh+lmo/TUs9FQIFD3qnQ0VvMUM+yopysuE24FFnONrC0Bpnnenh3dpY1g=
=zT5Q
-----END PGP SIGNATURE-----
You have a comma at the end of this:
bar = models.IntegerField(),
Could that be the issue?
François
On Apr 3, 2014, at 6:24 PM, Jorge Arevalo <jorgearevalo@libregis.org> wrote:
> Hello,
>
> I have this dummy models.py
>
> from django.db import models
>
> class Foo(models.Model):
> bar = models.IntegerField(),
> // more integer fields here...
> xyz = models.IntegerField()
>
> And I want to know the SQL code generated for PostgreSQL, executing:
>
> python manage.py sqlall myapp
>
> No south involved. Just Django 1.5.4. And this is the SQL output
>
> BEGIN;
> CREATE TABLE "myapp_foo" (
> "id" serial NOT NULL PRIMARY KEY,
> "xyz" integer NOT NULL
> )
> ;
>
> COMMIT;
>
> Just the internal id and the last specified field were generated. The rest are ignored. No matter how many fields or what fields. Just takes the last one, and generates that output.
>
> Does it make any sense? I'm running Django 1.5.4 under a virtualenv, using Python 2.7 in Ubuntu 12.04. This is the complete output of pip freeze in my virtualenv
>
> Django==1.5.4
> Jinja2==2.7.1
> MarkupSafe==0.18
> PIL==1.1.7
> Pygments==1.6
> Sphinx==1.1.3
> Unipath==1.0
> argparse==1.2.1
> distribute==0.6.24
> django-admin-tools==0.5.1
> django-appconf==0.6
> django-bootstrap3==2.0.0
> django-colorful==0.1.3
> django-compressor==1.3
> django-extensions==1.2.5
> django-geojson==2.1.1
> django-guardian==1.1.1
> django-leaflet==0.8.2
> django-model-utils==1.5.0
> django-secure==1.0
> django-sorting==0.1
> django-waffle==0.9.2
> docutils==0.11
> feedparser==5.1.3
> psycopg2==2.5.1
> requests==2.0.1
> six==1.4.1
> wsgiref==0.1.2
>
> This is just... weird. Any clues?
>
> Many thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ab753c1-96eb-4386-b031-dbc61aeeec9d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment