Re: Django database problem

2018-08-27 Thread Mikko Meronen
Yes it seems that I can influence to the 'jumps' with my management command. First my bot went through tens of items per loop, however when I changed the bot to check only 2 items per loop, the 'jumps' got smaller. So even though the table rows do not accrue (nothing is added) when no new items are

Re: Django database problem

2018-08-27 Thread Andréas Kühne
I have looked at this several times myself. :-) Regards, Andréas Den mån 27 aug. 2018 kl 13:33 skrev Jason : > oh, good catch. I didn't think of that, but you're right. > > > https://stackoverflow.com/questions/449346/mysql-auto-increment-does-not-rollback > > On Monday, August 27, 2018 at 3:

Re: Django database problem

2018-08-27 Thread Jason
oh, good catch. I didn't think of that, but you're right. https://stackoverflow.com/questions/449346/mysql-auto-increment-does-not-rollback On Monday, August 27, 2018 at 3:50:28 AM UTC-4, Andréas Kühne wrote: > > The management command could be wrapped within a transaction, this would > then in

Re: Django database problem

2018-08-27 Thread Andréas Kühne
The management command could be wrapped within a transaction, this would then in the database create a lot of models, but if the transaction fails - the rollback will not reset the database id. Regards, Andréas Den sön 26 aug. 2018 kl 12:29 skrev Mikko Meronen < mikkovillemero...@gmail.com>: >

Re: Django database problem

2018-08-26 Thread Jason
yeah, there is a limit, and its set by the data type you use for the id field. by default, id is set to IntegerField which has a maximum value of 2147483647 sounds like the issue with the ids jumping aro

Re: Django database problem

2018-08-26 Thread Mikko Meronen
Hi, Thanks for advice ^^ I have one new concern. Is there a limit for for Django model IDs? Now I have automated the data insert with python code loop, but the ID-number is not consecutive. It jumps for example from ...56 to 571... and from ...587 to 3763... and so forth. Do you know why it is

Re: Django Database Table Front End Editing

2018-08-22 Thread Mikhailo Keda
Check the documentation: https://docs.djangoproject.com/en/2.1/ref/databases/#connecting-to-the-database https://docs.djangoproject.com/en/2.1/topics/forms/ https://docs.djangoproject.com/en/2.1/ref/templates/ -- You received this message because you are subscribed to the Google Groups "Django u

Re: Django database problem

2018-08-20 Thread Jani Tiainen
Hi, Instead of doing everything by hand I would recommend doing a custom management command in Django. Because management commands live inside Django ecosystem you get full benefits of Django. Migrations to setup database tables from model definitions. Models and ORM to interact with database. (M

Re: Django database problem

2018-08-20 Thread Mikko Meronen
Hi and thanks for your help. I have tried postgress and now I have a problem using it. Here's my code following an error. I appreciate any help. def do(): x = 1 while x == 1: create_table() print('finding data') find_data() time.sleep(120) def create_table

Re: Django database problem

2018-08-17 Thread Mikhailo Keda
You could generate models from sqlite database - https://docs.djangoproject.com/en/2.1/howto/legacy-databases/ Than switch to PostgresQL -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fr

Re: Django database problem

2018-08-17 Thread Okware Aldo
Mikko, Check out this link below, it will help you understand how to connect you Django project to any DB manager. https://docs.djangoproject.com/en/2.1/intro/tutorial02/ On Fri, Aug 17, 2018 at 6:55 PM Mikko Meronen wrote: > Hi, > > I'm quite new with django and python and I wish someone coul

Re: Django database problem

2018-08-17 Thread Anirudh Jain
You will have to create a database on your system first (it is better to use mysql instead of sqlite) and then run commands :- 1. python manage.py makemigrations 2. python manage.py migrate Also you will have to create forms (forms.ModelForm or forms.Forms) for taking input. On Fri, 17 Aug 2018,

Re: Django + Database Connections

2014-11-13 Thread Russell Keith-Magee
On Wed, Nov 12, 2014 at 11:42 AM, Edward Armes wrote: > HI guys, > > Thanks for your responses, they have indeed answered all my questions > pretty much as I was mainly looking for information on how to modify how > Django accesses it's ORM layer. However from your answer it seems that it > would

Re: Django + Database Connections

2014-11-12 Thread Edward Armes
Hi Russell, Thank you for your response it has mainly answered my questions as well as given me areas to think about where to insert the asynchronous layer. Edward On Tuesday, 11 November 2014 21:25:44 UTC, Russell Keith-Magee wrote: > > Hi Edward, > > On Tue, Nov 11, 2014 at 12:30 AM, Edward

Re: Django + Database Connections

2014-11-12 Thread Edward Armes
HI guys, Thanks for your responses, they have indeed answered all my questions pretty much as I was mainly looking for information on how to modify how Django accesses it's ORM layer. However from your answer it seems that it would be better that I do it at the model layer. I apologize for being s

Re: Django + Database Connections

2014-11-11 Thread Kakar Nyori
Very nicely explained. On Wed, Nov 12, 2014 at 2:55 AM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > Hi Edward, > > On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes > wrote: > >> Hi there, >> >> I am currently looking at Django for a personal project. While I >> understand how a lot of

Re: Django + Database Connections

2014-11-11 Thread Russell Keith-Magee
Hi Edward, On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes wrote: > Hi there, > > I am currently looking at Django for a personal project. While I > understand how a lot of it works I can't wrap my head around how the actual > DB querying is done specifically what part of Django actually looks at

Re: Django Database Switching Issue

2014-07-14 Thread G Z
I solved it thanks for all your help though. On Monday, July 14, 2014 9:44:31 AM UTC-6, G Z wrote: > > Thomas, >> > > We are using an oracle database setup, we have a development database and > a production database, the production database is for billing. > The databases have the sane TNS resolv

Re: Django Database Switching Issue

2014-07-14 Thread G Z
> > Thomas, > We are using an oracle database setup, we have a development database and a production database, the production database is for billing. The databases have the sane TNS resolver name of DB1. To test that it was using the correct settings.py file I removed the database information

Re: Django Database Switching Issue

2014-07-11 Thread Thomas Lockhart
On 7/11/14 11:30 AM, G Z wrote: Thomas, I have no cache setup, Django is all set to default right now there is no local_settings file I have actually changed every settings file that exist for django to match my production db yet still the wrong data. Well, you will have to give more details o

Re: Django Database Switching Issue

2014-07-11 Thread G Z
Thomas, I have no cache setup, Django is all set to default right now there is no local_settings file I have actually changed every settings file that exist for django to match my production db yet still the wrong data. On Friday, July 11, 2014 10:30:23 AM UTC-6, Thomas wrote: > > On 7/11/14 9:

Re: Django Database Switching Issue

2014-07-11 Thread Thomas Lockhart
On 7/11/14 9:27 AM, G Z wrote: So I tracked down an issue, whenever I change my database from development to production which have the same exact schema it still uses the data from development although my settings.py file is set to the production database and it even swtiches the user I have to

Re: Django Database Data Type

2014-05-05 Thread Brendan Edwards
Thanks a lot for the reply! It got me thinking and I changed the code around a bit and was able to get the result I was looking for. What I did in the end was: teecolor = GolfCourseTees.objects.filter(Course_Name='course').values() tee1 = teecolor[0] and in the HTML i used {{ tee1.hole1_distanc

Re: Django Database Data Type

2014-05-05 Thread Mike Dewhirst
On 5/05/2014 5:39 PM, Brendan Edwards wrote: Hi, I have just started learning Django (been flip flopping between meteor and django, cant decide which to use..) and I am fairly new to web development in general. Basically, I have a query where I am using the code "teecolor = GolfCourseTees.objec

Re: django database cache for longtime?

2013-05-29 Thread Gonzalo Delgado
El 28/05/13 20:04, kase escribió: > i need cache a page where i'm process a lot information > > and i dont wish process again > and i dont wish keep in memory RAM, (maybe nobody ever review) > > so i wish put this page in a database cache but what can i do for never > expire? You want to use

Re: Django Database Improperly Configured when function called outside of Django

2012-06-12 Thread Nikolas Stevenson-Molnar
This appears to be the first point at which the database is accessed. |email_object = Email.objects.get(email=kwargs['email'])| I would print out some of the settings values before that point to make sure you're actually using the settings file you intend to use. E.g: from django.conf import set

Re: Django Database

2012-04-27 Thread Daniel Sokolowski
(Your site's contact us emails don't seem to work, hence below is a copy of my response to you) Mr Everett, It's unfortunate about your past developer but their loss could be an opportunity for the KL Insight that I work for. My name is Daniel Sokolowski and I can proudly tell you that I am ep

Re: Django database-api

2012-04-03 Thread KasunLak
Hi, Thanks you very much for the informative answer! It clears all the questions I had in my mind. Because I have some idea to build a tool to draw the model (UML) --> Generate Django Model code --> and then we can deploy it to db. Moreover I was thinking that if it possible to customize (edit exi

Re: Django database-api

2012-04-03 Thread akaariai
On Apr 3, 11:27 am, KasunLak wrote: > Hi, > > No, sorry for not giving more details. What I am asking is once we > syncdb the generated scripts (create table). Can we see the method > implementation of database access api? > > For example: If we have created and deployed a model called Poll > (tut

Re: Django database-api

2012-04-03 Thread KasunLak
Hi, No, sorry for not giving more details. What I am asking is once we syncdb the generated scripts (create table). Can we see the method implementation of database access api? For example: If we have created and deployed a model called Poll (tutorial example in django site) p = Poll.objects.get

Re: Django database-api

2012-04-03 Thread Eugenio Minardi
Hi, Do you mean the SQL generated by your model? In this case you can use python manage.py sql APPNAME On Tue, Apr 3, 2012 at 8:45 AM, KasunLak wrote: > Hi all, > > I just wonder is there a way to browse/view the code of database api > methods generated? Is there any tool for this? > > Thanks

Re: Django Database User-Side Access Basics

2012-03-14 Thread Nikolas Stevenson-Molnar
I think Fady means a tutorial for creating forms (not in admin) for editing polls. IIRC, the tutorial only covers editing polls via admin. Fady: I would take a look at the forms section of the docs: https://docs.djangoproject.com/en/1.3/topics/forms/. No tutorials, but plenty of example code.

Re: Django Database User-Side Access Basics

2012-03-14 Thread Javier Guerra Giraldez
On Wed, Mar 14, 2012 at 1:35 PM, Fady Kamal wrote: > no i need a tutorial to help me do these tasks that's exactly what was suggested: go to the Django site and do the tutorial. incidentally, most of the exercises are about a poll application -- Javier -- You received this message because yo

Re: Django Database User-Side Access Basics

2012-03-14 Thread Fady Kamal
no i need a tutorial to help me do these tasks On Wednesday, March 14, 2012 8:28:54 PM UTC+2, dummyman dummyman wrote: > > python official website will be good start > > On Wed, Mar 14, 2012 at 11:44 PM, Fady Kamal wrote: > >> Hello i am new to django and i've completed the Polls app tutorial >>

Re: Django Database User-Side Access Basics

2012-03-14 Thread dummyman dummyman
python official website will be good start On Wed, Mar 14, 2012 at 11:44 PM, Fady Kamal wrote: > Hello i am new to django and i've completed the Polls app tutorial > sucessfully,and what i want to do now *FROM THE USER SIDE *is the > following : > > 1-create poll. > 2-delete poll. > 3-edit the q

Re: Django Database User-Side Access Basics

2012-03-14 Thread dummyman dummyman
python official website will be good start On Wed, Mar 14, 2012 at 11:44 PM, Fady Kamal wrote: > Hello i am new to django and i've completed the Polls app tutorial > sucessfully,and what i want to do now *FROM THE USER SIDE *is the > following : > > 1-create poll. > 2-delete poll. > 3-edit the q

Re: django database

2011-05-26 Thread Jonas Geiregat
> do i have to install mysql to create a database in my website? As mentioned before you can use sqlite but consider the disadvantages: * Speed (sqlite for me ,even when developing a serious application, is a no go) When deleting large rows sqlite is remarkably slower then mysql. * I've seen s

Re: django database

2011-05-26 Thread Kenneth Gonsalves
On Thu, 2011-05-26 at 09:23 +, delegb...@dudupay.com wrote: > Sqlite is not advisable when doing serious deployment. > Just a thought. he said 'my website' which implies a small home-page thingie -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ --

Re: django database

2011-05-26 Thread Stuart MacKay
Bahare, MySQL is probably your best option for deployment (SQLite works really well for development). The tools are easy to use and it is more than capable for handling very large loads. For various technical reasons postgresql might be a better choice but you only need to consider this when

Re: django database

2011-05-26 Thread delegbede
Subject: Re: django database On Thu, 2011-05-26 at 09:44 +0430, bahare hoseini wrote: > do i have to install mysql to create a database in my website? yes (or postgresql or sqlite) -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received t

Re: django database

2011-05-25 Thread Kenneth Gonsalves
On Thu, 2011-05-26 at 09:44 +0430, bahare hoseini wrote: > do i have to install mysql to create a database in my website? yes (or postgresql or sqlite) -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- You received this message because you are subscr

Re: Django Database problems

2010-08-25 Thread Reinout van Rees
On 08/25/2010 05:51 PM, Xavier Ordoquy wrote: Hi, You may have several django versions in your path. The settings under apears to be django 1.1 In your project, try: $ python manage.py shell import django print django.__file__ print django.VERSION Yeah, and also do an "import sys" followed by

Re: Django Database problems

2010-08-25 Thread Xavier Ordoquy
Hi, You may have several django versions in your path. The settings under apears to be django 1.1 In your project, try: $ python manage.py shell >>> import django >>> print django.__file__ >>> print django.VERSION Regards, Xavier. Le 25 août 2010 à 17:41, Robbington a écrit : > I'm using Sqlite

Re: Django Database problems

2010-08-25 Thread Robbington
I'm using Sqlite DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '/var/www/django/robproject/rbdata.db' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATA

Re: Django Database problems

2010-08-25 Thread Reinout van Rees
On 08/25/2010 05:03 PM, Robbington wrote: I've been using Django for about a month now, with no real problem on my linode vps with ubuntu. For some reason now everytime I start a new project I cant sync the database. I get a "Need to fill in the database name' message even though it clearly fill

Re: Django database model interface for other python projects?

2009-06-28 Thread Alex Gaynor
On Sun, Jun 28, 2009 at 6:03 PM, dartdog wrote: > > One of the reasons I'm enduring the pain of getting into Django is > it's very clever way of being able to use Python libs and visa versa > in a very loosely coupled manner. People seem to pick and choose what > they want to use. Not fully under

Re: Django database model interface for other python projects?

2009-06-28 Thread dartdog
One of the reasons I'm enduring the pain of getting into Django is it's very clever way of being able to use Python libs and visa versa in a very loosely coupled manner. People seem to pick and choose what they want to use. Not fully understanding you question I'd say of course you can! On Jun 28

Re: Django database connections

2009-02-14 Thread Alex Gaynor
On Sat, Feb 14, 2009 at 4:15 PM, Jack Orenstein wrote: > > I'm trying to understand how Django 1.0 handles connections. This is > from the django docs, on the subject of raw SQL: > > from django.db import connection > cursor = connection.cursor() > cursor.execute("select ...") > r

Re: django database SQLite3

2008-12-14 Thread Dave Dash
Is sqlite3 part of yoru windows path? Otherwise you can run sqlite3 with the path to your db... e.g. sqlite3 c:\Users\Benjamin\Desktop\mysite\data\website.sqlite or wherever your sqlite db is stored. On Dec 14, 5:10 am, ben852 wrote: > C:\Users\Benjamin\Desktop\mysite\sqlite3 > SQLite3 versio

Re: Django Database Relationship Question

2008-06-27 Thread bhunter
> And this is why the Django community rocks, two examples and a full > explaination with a link in less than 10 minutes, GW guys Absolutely! Thank you all so much! In just 15 minutes I had great answers from everyone. --~--~-~--~~~---~--~~ You received this me

Re: Django Database Relationship Question

2008-06-26 Thread [EMAIL PROTECTED]
You may also be interested in this ticket: http://code.djangoproject.com/ticket/6095 (which will hopefully be hitting relatively soon). On Jun 26, 11:27 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > You'd almost think they were handing out prizes for being quickest on   > the draw :) > > On J

Re: Django Database Relationship Question

2008-06-26 Thread Eric Abrahamsen
You'd almost think they were handing out prizes for being quickest on the draw :) On Jun 27, 2008, at 12:18 PM, joshuajonah wrote: > > And this is why the Django community rocks, two examples and a full > explaination with a link in less than 10 minutes, GW guys > > On Jun 26, 11:55 pm, bhunt

Re: Django Database Relationship Question

2008-06-26 Thread joshuajonah
And this is why the Django community rocks, two examples and a full explaination with a link in less than 10 minutes, GW guys On Jun 26, 11:55 pm, bhunter <[EMAIL PROTECTED]> wrote: > Hi, sorry for what is probably a trivial question, but I'm new to > Django and a little fuzzy on databases in gen

Re: Django Database Relationship Question

2008-06-26 Thread Eric Abrahamsen
Hey there, A M2M field creates an intermediary join table which doesn't show up in the admin, or other places. It's basically just a pairing of Journalist ids with Article ids, and the M2M field is a convenience that allows you to ignore this table. If you want to add additional informati

Re: Django Database Relationship Question

2008-06-26 Thread Julien
Hi, To do that I would use an auxilliary model: class Journalist(models.Model): pass class Article(models.Model): pass class JournalistArticleRelationship(models.Model): journalist = models.ForeignKey(Journalist) article = models.ForeignKey(Article) status = models.Charfield() Tha

Re: Django Database Relationship Question

2008-06-26 Thread joshuajonah
Well you'd want a relational table of author status', some thing like this: class Journalist(models.Model): name = models.Charfield() class Article(models.Model): articles = models.Charfield class State(models.Model): state = models.CharField() class Article_relationship(models.Model):

Re: django database setup problem

2007-10-04 Thread Joseph Heck
I'd recommend installing http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/MySQL-python-1.2.0-1.i386.rpm If I remember correctly, Fedora (RPM) has no trouble with using a remote RPM file - so the following should do the trick: rpm -Uvh http://download.fedora.redhat.c

Re: django database setup problem

2007-10-04 Thread swati
Thanks Joe, I recompiled the python with zlib support and tried to install mysqldb, now I am not getting the error of zlib anymore. But got error with gcc compiler. Part of the error is something like,- --

Re: django database setup problem

2007-10-03 Thread Joseph Heck
You're on the right track - missing the MySQL python libraries. It looks like Python is also missing the zlib libraries... not sure which OS you're using, but there's probably an "apt-get install ..." or "rpm -Uvh ..." command that will get you the MySQL Python libraries that you need. Looking on

Re: django database access with threadpool

2007-09-11 Thread johnny
I can someone tell me how the database connection is handled for threads. Do I have to pass conneciton object to each threads? All I am doing is this: @threadpool(pool) def process(i): print 'threadpool %i enter' % i p = Profile.objects.get(id=i) p.status ="sent" p.save()

Re: Django database API - What is it good for?

2007-08-13 Thread TheMaTrIx
Also, if I'm not mistaken, when you use the database api, the input validation steps are taken care of by the framework, you don't just tell in the models what format fields should be in the database, but at the same time are telling the framework what input it should accept for that field. If a f

Re: Django database API - What is it good for?

2007-08-13 Thread Collin Grady
> >>> users = User.objects.filter(groups__contains="Staff") ? This line doesn't work because "groups" is a ManyToManyField, not a CharField, so __contains="Staff" doesn't make any sense. Something like users = User.objects.filter(groups__name="Staff") should work a little better :) --~--~-

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, Amirouche <[EMAIL PROTECTED]> wrote: > What do you mean, I can't understand. OK, suppose you are running an online store, so you have a database table "orders", which lists orders customers have placed, and another "addresses" which lists the addresses to ship the orders to. To calcul

Re: Django database API - What is it good for?

2007-08-13 Thread Amirouche
On Aug 13, 3:19 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/13/07, sagi s <[EMAIL PROTECTED]> wrote: > > > Surely not. It is... darn - Can I just use SQL and be done with it? > > Of course. > > But keep in mind that, when programming in an object-oriented > language, it's often more us

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, sagi s <[EMAIL PROTECTED]> wrote: > Surely not. It is... darn - Can I just use SQL and be done with it? Of course. But keep in mind that, when programming in an object-oriented language, it's often more useful to get back a set of domain-specific objects -- which requires using Djang

Re: Django database referential problem

2007-04-25 Thread Drasty
Depending on how you want to limit versions in your projects, you could do something with the "limit_choices_to" argument in your ForeignKey. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Django database referential problem

2007-04-25 Thread Gerry Steele
Thanks for the reply Yaron. I think I was basically over thinking the whole thing. The ManyToMany was a mistake, you were right, as there is another class that should need manytomany. (each Issue will potentially relate to more than one ProjectVersion). The admin still displays all versions,

Re: Django database referential problem

2007-04-25 Thread Yaron Buskilla
Hi Gerry. Why do you use the many to many field for version in the project model ? I think all you have to do is define the ForiegnKey as you did in the ProjectVersion model and it is enough . Because every project has many versions. Then you can get the versions of a projetc by writing : p =