Re: database design approach

2023-02-01 Thread vamsikrishna Aliveli
Hi , If you are using single model you use single model with multiple fields .If you are using multiple models you can use Foreign field to refer other model in current model.(Player model) On Wed, 1 Feb 2023, 20:33 datasci via Django users, < django-users@googlegroups.com> wrote: > I am designi

Re: Database Saving

2022-09-22 Thread Walter Randazzo
R u using createview class? Regards, El jue, 22 sept 2022 a las 20:28, Saudi Mostafa () escribió: > I have a project with simple form ,when submit directed to the list > without saving > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. >

Re: Database objects do not implement truth value testing

2022-02-24 Thread Kasper Laudrup
On 24/02/2022 16.18, Pradumn Maurya wrote: Dear Sir/Mam I just face this problem when i am using makemigrations cmd, how can i fix this. Can any one help me solve this problem? I'm fairly certain no one will be able to help you solve this problem if you don't describe it a bit more in detail

Re: Database design

2022-01-23 Thread Derek
The best approach is for the Django/DB devs to create these fields (and forms) in advance for the users to enter data. If you want users to add "key/pair" type data which is not known in advance, look to adding a JSON column to your table; see: https://www.postgresql.org/docs/14/datatype-json.ht

Re: Database design

2022-01-23 Thread Madhusudhan Reddy
Ohh you want create custom fields in forms Take input, select, textarea tags, make them their own fields but save all of these in fields in one table with types and max values all of the attributes of tags Finally show then what they chosen On Sun, 23 Jan 2022 at 2:28 PM, Prashanth Patelc wro

Re: Database audit fields in Django

2020-05-24 Thread Derek
There are many things available "by default" in other frameworks; but Django has chose to keep the core focused on doing key things well (I won't say "simple"). For everything else, the plugin/app approach can be used to support your project's specific needs. So "auditing" is actually a comple

Re: Database audit fields in Django

2020-05-22 Thread Sebastian Jung
Hello, You must create it over models.py. please Take a Look Here https://stackoverflow.com/questions/2771676/django-datetime-issues-default-datetime-now Another field Like Lastchangefromuser you must created it AS onetoone field in models.py and in Views you can Insert requests.user to fill curr

Re: Database audit fields in Django

2020-05-22 Thread Gabriel Araya Garcia
You can see it in ADMIN tables of Django Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos 99.7721.15.70 El vie., 22 may. 2020 a las 17:39, Sujata Aghor () escribió: > I am looking to create a database audit fields such as 'created by' , ' > modified by', 'created on time', ' modi

Re: Database migration issue

2020-04-12 Thread wanbao jin
Ok, I figure it out, When application configuration class is used in INSTALLED_APPS, the name field of AppConfig subclass should be the path of that application. AppConfig.name¶ > > Full > Python path to the applic

Re: Database migration issue

2020-04-12 Thread wanbao jin
> > When I just change the api.blogs.apps.BlogsConfig to api.blogs , it > worked fine. I am curious why api.blogs.apps.BlogsConfig doesn't work > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop rec

Re: Database connection not pointing to the correct database backend

2020-03-01 Thread maninder singh Kumar
Try using another user and password and not 'root' [image: --] Maninder Kumar [image: http://]about.me/maninder.s.kumar On Sun, Mar 1, 2020 at 1:51 AM Cam wrote: > I'm running Ubuntu and I'm trying to create a small web-app connecting to >

Re: Database connection not pointing to the correct database backend

2020-02-29 Thread Agumba .
Try using pymysql... Add the following in your project root __init__.py ie. `import pymysql pymysql.version_info = (1, 3, 13, "final", 0) pymysql. install_as_MySQLdb() ` On Sun, Mar 1, 2020, 07:34 karthik s wrote: > Hi cam, > well I solved same problem by removing virtual environment and > rein

Re: Database connection not pointing to the correct database backend

2020-02-29 Thread karthik s
Hi cam, well I solved same problem by removing virtual environment and reinstalling all the packages again. it worked for me then, I have now access to mysql database .. afterthat you have python 2.xx version pip install otherwise python3.xx version pip3 install On Sun, Mar 1, 2020 at 1:51 AM C

RE: Database ORM query Help

2019-10-26 Thread dvdcedar
) status = models.CharField(max_length=25, choices=STATUS_TYPES, default=PENDING) From: django-users@googlegroups.com On Behalf Of wd Sent: Saturday, 26 October 2019 11:43 AM To: django-users@googlegroups.com Subject: Re: Database ORM query Help I think you could conside

Re: Database ORM query Help

2019-10-25 Thread wd
I think you could consider using raw sql, https://docs.djangoproject.com/en/2.2/topics/db/sql/#executing-custom-sql-directly On Fri, Oct 25, 2019 at 7:56 PM Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggling to create the Djang

Re: Database ORM query Help

2019-10-25 Thread Samiul Sk
Please post the code of Model and explain what do you want as Queryset? On Fri, 25 Oct 2019 at 17:26, Cheda me wrote: > Hey guys, > > I have worked out the SQL query I would like to implement but am currently > struggling to create the Django query. I have been attempting to use the > .aggregat

Re: database could't connect in python to atom

2019-10-22 Thread wd
hi, Maybe you need to check what mysql.connector is. What's the output for 'dir(mysql.connector)' ? On Wed, Oct 23, 2019 at 11:08 AM MEGA NATHAN wrote: > Hi. > > AttributeError: module 'mysql.connector' has no attribute 'connect' > > > > > > regards > Meganathan, > > -- > You received this mess

Re: database could't connect in python to atom

2019-10-22 Thread Suraj Thapa FC
You are using wrong syntax for connecting sql On Wed, 23 Oct, 2019, 8:38 AM MEGA NATHAN, wrote: > Hi. > > AttributeError: module 'mysql.connector' has no attribute 'connect' > > > > > > regards > Meganathan, > > -- > You received this message because you are subscribed to the Google Groups > "Dj

Re: Database connection closed after each request?

2019-09-30 Thread deb.dasit2013
Hi Mike, I tried with custom persistent connection, but results in same error. My environment is Django + postgres + nginx + gunicorn On Saturday, August 29, 2009 at 5:38:58 PM UTC+5:30, Mike wrote: > > Hi, > > I made some small custom psycopg2 backend that implements persistent > connection us

Re: Database Views

2019-08-27 Thread Doddahulugappa.B
Thank you. I got it.. Issue with timezone By default django considering TIME_ZONE = 'UTC' USE_TZ = True Thats the reason it was showing less records than actual.. I changed it local to local time zone name and USE_TZ = False Its working perfectly.. I also understood that its not only to database

Re: Database Views

2019-08-27 Thread Doddahulugappa.B
Thanks for your response. In Django models.. For example class TempUser(models.Model): first_name = models.CharField(max_length=100) class Meta: managed = False db_table = "temp_user" temp_user is database view. Now assume select * from temp_user Gives 5 records Sa

Re: Database Views

2019-08-27 Thread Jani Tiainen
Hi. You really need to provide more context. Without knowing your data, tables involved in a view. Your model and query you used and query you used to verify wrong (or correct) results it is virtually impossible to help you further. ti 27. elok. 2019 klo 17.47 HULUGESH B kirjoitti: > Hi All, >

Re: database migrations

2019-08-04 Thread Mike Dewhirst
Once I have a database I wish to replicate many times for testing I just use pg_dump to create a json file which can be reloaded into an empty database as often as required. For that I use a script which sequentially calls dropdb, createdb and finally psql which nominates the json dump file cre

Re: database migrations

2019-08-04 Thread Jani Tiainen
Hi. To me this sounds more debugging issue than migrations or database problem. Since it is most definitely your code that doesn't work right. Of course if youre building and testing features that fill thousands of entries or relatively complex data there are options. Personally I use "template

Re: database migrations

2019-08-03 Thread Perceval Maturure
Thanks Roger. On Sun, 04 Aug 2019 at 01:19, RLM wrote: > Why try to avoid re populating the database? That's the easy part, > figuring what went wrong is more difficult.You don't need a lot of data to > get an app working, you just need to understand what you want and how to > achieve it. > > W

Re: database migrations

2019-08-03 Thread RLM
Why try to avoid re populating the database? That's the easy part, figuring what went wrong is more difficult.You don't need a lot of data to get an app working, you just need to understand what you want and how to achieve it. When I was learning django I rebuilt my events database 20 times s

Re: database migrations

2019-08-03 Thread Perceval Maturure
Question is what’s the best way forward to avoid situations where u will have to create a new database if ur applications do not work with the current databases so as to avoid populating the database with data again Sent from my iPhone > On 02 Aug 2019, at 14:39, Perceval Maturure wrote: >

Re: database migrations

2019-08-03 Thread Jani Tiainen
Hi. So... what is the actual question? pe 2. elok. 2019 klo 15.40 Perceval Maturure kirjoitti: > Dear all > creating a new database as applications increase has been one of the > solutions to some of the errors i have encountered especially after adding > a django cms by hand in my development

Re: Database setup

2019-05-13 Thread Devender Kumar
You need to make model for that where managed = false in class meta of the model. even you can generate complete table model from the db. On Friday, May 10, 2019 at 8:29:40 PM UTC+5:30, Soumen Khatua wrote: > > Hi Folks, > > I have one existing table in my database then how I can use the same ta

Re: Database setup

2019-05-10 Thread Lucas G. Navarro
Hi Soumen, i think that what you need is this [1] Regards! El vie., 10 may. 2019 a las 11:59, Soumen Khatua () escribió: > Hi Folks, > > I have one existing table in my database then how I can use the same table > in my models.

Re: Database setup

2019-04-22 Thread Sipum
Hi somen, Just Open xampp control panel and run apache and mySQL sever. then go to localhost/phpmyadmin in browser and there create a database as u do for php. then in search DATABASE in settings.py file (which would be created when u create a project in django) do the below changes - DATABAS

Re: Database setup

2019-04-19 Thread Okware Aldo
So if you launch xampp and you are sure all the services are running. services (Apache, MySQL, and PHP), xampp also ships with phpmyadmin a mysql webbased interface. which you can launch by typing `localhost/phpmyadmin` in any browser of choice. Once the PHPMyAdmin interface is launched. using thi

Re: Database setup

2019-04-19 Thread Soumen Khatua
Yes I already install xampp server but what will be my password? Actually for development purpose xampp server not accept any password, I guess!! Thank you for your valuable time. On Sat, 20 Apr 2019, 10:48 Okware Aldo, wrote: > Hey, If you have xampp installed, just create a database using ph

Re: Database setup

2019-04-19 Thread Okware Aldo
Hey, If you have xampp installed, just create a database using phpmyadmin, attach a user to that database. then ensure you have a driver package installed and setup for django. eg. pymsql has worked well for. then make the necessary changes in django settings file. On Fri, Apr 19, 2019 at 9:21 PM

Re: Database data caching in Django?...

2018-07-09 Thread Ravi Bhushan
Can we solve this problem ? https://stackoverflow.com/questions/51239469/cache-invalidation-is-not-working-in-browser-using-or-app-rest-api On Thursday, August 18, 2016 at 1:04:33 AM UTC+5:30, Fred Stluka wrote: > > Django users, > > Is there an easy way to enable an automatic write-through > dat

Re: Database

2018-07-01 Thread Tomasz Knapik
Django has support for Postgres-only features - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/ - if you need any of them. Also full text search is much easier to implement with Postgres in Django - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/search/ Also I am not s

Re: Database

2018-06-30 Thread Mike Dewhirst
I've used both. If you have a choice use Postgres. Mike Connected by Motorola ABHISHEK PARMAR <150305105...@paruluniversity.ac.in> wrote: >Should i use postgres or mysql ? > >-- >You received this message because you are subscribed to the Google Groups >"Django users" group. >To unsubscribe

Re: Database

2018-06-30 Thread Mark Phillips
Use whichever one you are more familiar with, unless there is a technical reason for your specific project to pick one over the other. Familiarity is important if you are just learning django, as you don't need too many learning curves at the same time. Sometimes, it is helpful to look at the table

Re: Database

2018-06-30 Thread Joshua Kayode
Use postgresql, but you can find reasons not to!, the choice between MySQL and postgresql is more or less personal! Both have their strengths and weakness! On Jun 30, 2018 14:05, "ABHISHEK PARMAR" <150305105...@paruluniversity.ac.in> wrote: > Should i use postgres or mysql ? > > -- > You receiv

Re: database update after paypal payment

2018-04-25 Thread mab . mobile . 01
Hello Michael, I am having the same problem. I have no problems submitting the data from my website to paypal. I am using Django 2.0.x and just need the django IPN-listener code in an easy to understand way. I want to receive data back from paypal IPN and be able to store it in my database ie

Re: Database scheme for a simple quiz app

2017-09-24 Thread Mike Dewhirst
On 25/09/2017 4:06 AM, Maitreya Verma wrote: I am trying to make a simple website where people can take quizzes (there can be multiple quizzes for any user) and their results ( as well as the option they chose) has to be stored. For that, I made a custom user class which will store details of a

Re: Database router with read replica

2017-08-31 Thread Antonis Christofides
Hi, When I once faced this problem I used django-multidb-router . It uses the term "pinning" for the fact that after a query to the master database it "pins" itself to the master database, i.e. uses the master database exclusively for the rest of t

[Solved] Re: database tables are not being created

2017-08-09 Thread jjanderson52000
Andreas, Thank you for the help. It turned out my __init__.py file was missing in my migration directories. Once added, everything ran great. Jim On Monday, August 7, 2017 at 3:33:18 PM UTC-4, jjander...@gmail.com wrote: > > > I have been working on a django application for several months, lea

Re: database tables are not being created

2017-08-07 Thread Vijay Khemlani
As far as I know you also need to declare the app_label for each model class Meta: app_label = 'your_app_name_here' On Mon, Aug 7, 2017 at 4:15 PM, Andréas Kühne wrote: > Ok, > > Regarding point 2 there - have you added the models to the __init__.py > file? Imported them as in: > > from .mo

Re: database tables are not being created

2017-08-07 Thread Andréas Kühne
Ok, Regarding point 2 there - have you added the models to the __init__.py file? Imported them as in: from .model1 import Model1 As far as I have seen, this is needed to make sure the migrations can detect the models. Regards, Andréas 2017-08-07 22:09 GMT+02:00 : > > Andreas, > > The apps ar

Re: database tables are not being created

2017-08-07 Thread jjanderson52000
Andreas, The apps are included in the INSTALL_APPS in settings.py With regard to the models file, I'm not sure what you are referring to. In my application there is a driectory 'models' and in that directory, there is a separate file for each model and inside each of those files there is a cl

Re: database tables are not being created

2017-08-07 Thread Andréas Kühne
Have you added the application your models belong to to the INSTALLED_APPS part of settings.py? And have you added the models file in that application? Regards, Andréas 2017-08-07 21:33 GMT+02:00 : > > I have been working on a django application for several months, learning > as I go. I have ru

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread Guilherme Leal
Hey man, if you have any problem, ALWAYS check the django documentation in the first place. IMO, its preaty extensive and complete, and always helped me through the 4~5 years I'm developing with django. After that, stackoverflow always help ( =P ). And if the things still goes badly, django-users

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread pieceofkayk2718
Hey thanks for that extra input. I'm currently a student at NMSU making an educational app for NASA'S Planetary Data Systems. Right now I'm the only student working on it and the only person in my building that knows Django (which I'm learning on the job). I'm making a blog alongside my app t

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread Guilherme Leal
Np man, always glad to help! Just to seal the case, that happened because django dont edit the migration files itself (well, not through the normal cycle of "makemigrations">"migrate"). You generated a migration with an invalid config, and didnt even mattered if you tried to correct that "default

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread pieceofkayk2718
Oh dude you are officially my hero! I didn't even think about the migration files. That totally worked. And thank you thank you thank you =D <3. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread Guilherme Leal
Just to clarify: Change the default value to "False"; Delete the migration file (0012_auto_20170630_1027); Run makemigrations; Run migrate. 2017-06-30 15:08 GMT-03:00 Guilherme Leal : > Have you re-ran the "makemigrations"? If that didnt work, delete the > migration file (0012_auto_20170630_1027

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread Guilherme Leal
Have you re-ran the "makemigrations"? If that didnt work, delete the migration file (0012_auto_20170630_1027) and run "makemigrations" again. 2017-06-30 15:04 GMT-03:00 : > I also did the "If all else fails, reboot your computer" and still have > the same problem. Haha. I think I'm screwed. > >

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread pieceofkayk2718
I also did the "If all else fails, reboot your computer" and still have the same problem. Haha. I think I'm screwed. -- 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 ema

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread pieceofkayk2718
Yes. At first I tried setting default=True or default=False for my BooleanField and kept getting the same error. So I went back in, deleted the model, tried again, got the same error. Then I deleted my db sqlite3 file, made new migrations, migrated (with the model not even a part of my model

Re: Database validation error - Even after manage.py flush.

2017-06-30 Thread Guilherme Leal
>>>django.core.exceptions.ValidationError: [u"'' value must be either True or False."] Have you tried to set the default value of the BooleanField as True or False? BooleanFields must have a valid boolean as default value and so happends that empty string is not a valid boolean. Change the d

Re: Database Routing

2017-05-18 Thread Derek
You'll need to post actual code and error stack traces if you want people to help. On Wednesday, 17 May 2017 15:08:55 UTC+2, Joe wrote: > > I am in the process of setting up a django server. I am trying to connect > our 4 legacy DBs to her. I have created a separate app for each DB, added > the

Re: DATABASE DICTIONARY in Settings.py

2017-04-04 Thread alkhairohr
Thank you so much for all this info. This really clarified things for me. On Tuesday, April 4, 2017 at 1:42:44 AM UTC-4, Antonis Christofides wrote: > > Hello, > > this is far from an incredibly stupid question. > > As you know, RDBMS's keep their own list of users and have sophisticated > permi

Re: DATABASE DICTIONARY in Settings.py

2017-04-03 Thread Antonis Christofides
Hello, this is far from an incredibly stupid question. As you know, RDBMS's keep their own list of users and have sophisticated permissions systems with which different users have different permissions on different tables. This is particularly useful in desktop applications that connect directly

Re: DATABASE DICTIONARY in Settings.py

2017-04-03 Thread Mike Dewhirst
On 4/04/2017 5:50 AM, alkhair...@mymail.vcu.edu wrote: Hey everyone, I'm new to Django and web development overall so please bare with me. I may be asking an incredibly stupid question. In the DATABASES dictionary in settings.py: DATABASES = { 'default': { 'NAME': 'somethin

Re: database update after paypal payment

2017-03-22 Thread Michael Goytia
Hello, If you still need help please email me and I can assist you. also look at this page Michael Goytia On Wednesday, March 1, 2017 at 7:11:08 PM UTC-7, Agou

Re: database update after paypal payment

2017-03-01 Thread Agoulou Zegouna
Thanks all ! I tried to Use django-paypal. can you please give me a concrete example after from step 5 to 6? I have no idea of what to do? https://django-paypal.readthedocs.io/en/stable/standard/ipn.html On Wed, Mar 1, 2017 at 1:46 PM, Mario Gudelj wrote: > You should use Django-PayPal app. It

Re: database update after paypal payment

2017-03-01 Thread Mario Gudelj
You should use Django-PayPal app. It has views for IPN and PDT, stores transaction details in DB, does TX verification and it fires of a signal when when a successful transaction comes in to your webhook. All you have to do is specify some URLs and settings. It'll even render that front end form f

Re: database update after paypal payment

2017-03-01 Thread Melvyn Sopacua
On Tuesday 28 February 2017 21:13:39 agoulouzego...@gmail.com wrote: > hello! I am trying to update my database after paypal has received > the payment from customer. The problem is that I don't really know to > do it. This is what I am doing now This code is all irrelevant. This is the important

Re: Database is not reset after StaticLiveServerTestCase (Django 1.9.5)

2016-09-12 Thread Tim Graham
Yes, a minimal example project that demonstrates the issue would be helpful. My guess is that you have a mistake in your tests that's causing some state to leak between them. On Monday, September 12, 2016 at 9:36:23 AM UTC-4, ankitj...@gmail.com wrote: > > Hello, > > I have a Python project tha

Re: Database data caching in Django?...

2016-08-17 Thread Avraham Serour
https://djangopackages.org/grids/g/caching/ On Wed, Aug 17, 2016 at 11:43 PM, Tim Graham wrote: > I did a quick search and found https://github.com/BertrandBordage/django- > cachalot. Does it meet your requirements? > > > On Wednesday, August 17, 2016 at 3:34:33 PM UTC-4, Fred Stluka wrote: > >

Re: Database data caching in Django?...

2016-08-17 Thread Tim Graham
I did a quick search and found https://github.com/BertrandBordage/django-cachalot. Does it meet your requirements? On Wednesday, August 17, 2016 at 3:34:33 PM UTC-4, Fred Stluka wrote: > > Django users, > > Is there an easy way to enable an automatic write-through > database cache in Django? >

Re: Database Modeling Help - Relating Instance Fields to Instance Fields

2016-03-14 Thread MattDale
I figured it out, I think. If I create an intermediary table like this: class PatchConnection(models.Model): connection = models.ForeignKey(Connection) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content_object =

Re: Database inserts with autocommit set to off.

2015-07-28 Thread Maciej Gol
Thanks a lot! I've ended up using `django-transaction-hooks`. On Monday, July 27, 2015 at 5:49:40 PM UTC+2, Carl Meyer wrote: > > Hi Maciej, > > On 07/27/2015 07:03 AM, Maciej Gol wrote: > > I've been recently working (porting to Django 1.8) on a project where we > > need to use a few transacti

Re: Database inserts with autocommit set to off.

2015-07-27 Thread Carl Meyer
Hi Maciej, On 07/27/2015 07:03 AM, Maciej Gol wrote: > I've been recently working (porting to Django 1.8) on a project where we > need to use a few transactions in a single request, and these > transactions cannot be correctly handled by the `atomic` decorator due > to functions calls nesting. Bas

Re: Database and migrations are out of sync.

2015-04-24 Thread felix
El 24/04/15 12:16, Tim Graham escribió: I don't think so. When you create your initial migrations, you need to ensure they match the scheme of your database. After that, things shouldn't get out of sync. Any idea how that happened in the first place? On Friday, April 24, 2015 at 8:54:19 AM UTC

Re: Database and migrations are out of sync.

2015-04-24 Thread Tim Graham
I don't think so. When you create your initial migrations, you need to ensure they match the scheme of your database. After that, things shouldn't get out of sync. Any idea how that happened in the first place? On Friday, April 24, 2015 at 8:54:19 AM UTC-4, Андрей Лукьянов wrote: > > Hi everyone

Re: Database queries location

2014-12-26 Thread Collin Anderson
Hi, That should all be possible. from django.db import models class MyManager(models.Manager): def complex_query_with_multiple_tables(self, mutiple, post, values): # put your query here. Collin On Tuesday, December 23, 2014 12:49:49 PM UTC-6, pythonista wrote: > > Can this be used

Re: Database queries location

2014-12-23 Thread pythonista
Can this be used with a complex query in which multiple tables (classes) are being joined? I also have to pass multiple post values to the query. Thanks for the example On Monday, December 22, 2014 8:52:04 PM UTC-5, Collin Anderson wrote: > > Hi, > > There's a good example of creating a cust

Re: Database queries location

2014-12-22 Thread Collin Anderson
Hi, There's a good example of creating a custom manager here: https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers Collin On Saturday, December 20, 2014 8:28:57 AM UTC-6, pythonista wrote: > > Thank you for your response. > > Most of my data is complex raw sql. > I had pla

Re: Database queries location

2014-12-20 Thread pythonista
Thank you for your response. Most of my data is complex raw sql. I had placed it in the views and it is working as expected I would like to migrate the raw sql to managers, Can you point me to one or more good examples of how the manager is coded and how the sql interacts with the views. Tha

Re: Database queries location

2014-12-19 Thread aRkadeFR
Depend exactly on what to compute for your post data. I would almost write no logic code in the views. I split every application as follow: - managers.py: All the logic as a table level (raw SQL, complex queries) - models.py: All logic as a row level / object level (python computing data) - form

Re: Database queries location

2014-12-18 Thread Lachlan Musicman
I usually put those functions in the view cheers L. On 19 December 2014 at 08:12, pythonista wrote: > I understand that functions can be placed in the models fille > > However if I have complex queries that receive post input does the > > > Query live in the model the views or an external module

Re: DATABASE in settings file not working

2014-12-11 Thread dennis breland
Thanks. I've spent hours on this silly typo. On Thursday, December 11, 2014 9:53:12 AM UTC-5, François Schiettecatte wrote: > PASSSWORD => PASSWORD > > > > On Dec 11, 2014, at 9:26 AM, dennis breland > wrote: > > > > Please help with this problem... > > > > > > I am getting an access de

Re: DATABASE in settings file not working

2014-12-11 Thread François Schiettecatte
PASSSWORD => PASSWORD > On Dec 11, 2014, at 9:26 AM, dennis breland wrote: > > Please help with this problem... > > > I am getting an access denied error when running Django; details follow: > Currently installed versions: > Python 2.7.3 > MySQL-python package 1.2.3 >

Re: DATABASE in settings file not working

2014-12-11 Thread dennis breland
Please help with this problem... I am getting an access denied error when running Django; details follow: Currently installed versions: Python 2.7.3 MySQL-python package 1.2.3 Django 1.7 I previously used the Django tutorial and successfully used the polling app

Re: Database "postgres" does not exist error when running test command

2014-11-15 Thread Thomas G Lockhart
On Nov 15, 2014, at 6:02 AM, Daniel Grace wrote: > On Saturday, 15 November 2014 00:58:32 UTC, Aliane Abdelouahab wrote: > how about this > http://stackoverflow.com/a/19426770/861487 > > > That link, what is that about? > > Anyway, I manually created a database called "postgres" and the error

Re: Database "postgres" does not exist error when running test command

2014-11-15 Thread Daniel Grace
On Saturday, 15 November 2014 00:58:32 UTC, Aliane Abdelouahab wrote: > > how about this > http://stackoverflow.com/a/19426770/861487 > > That link, what is that about? Anyway, I manually created a database called "postgres" and the error went away. -- You received this message because you are

Re: Database "postgres" does not exist error when running test command

2014-11-14 Thread Aliane Abdelouahab
how about this http://stackoverflow.com/a/19426770/861487 Le vendredi 14 novembre 2014 18:10:41 UTC+1, Daniel Grace a écrit : > > Hi, > I get an error when running the test command: > >python manage.py test flow > > Creating test database for alias 'default'... > Traceback (most recent call last):

Re: Database field for Image Upload

2014-10-29 Thread Bill Freeman
Note that if these images will be displayed on the site it is best done by your front end (Apache, ngnx, etc.) since the HTML to show them treats them as a separate request, and serving static files is your front end's forte. The front end knows how to do this with files, but probably not with data

Re: Database field for Image Upload

2014-10-29 Thread pjotr
https://docs.djangoproject.com/en/1.7/ref/models/fields/#imagefield The image file will not be stored in the database, but in MEDIAROOT by default. So maybe this is not the answer to your question. On Wednesday, October 29, 2014 10:18:30 AM UTC+1, Shubham Gupta wrote: > > Is there any way from

Re: Database configuration errors saying 'ENGINE' isn't set when it is

2014-09-02 Thread Shaun Kruger
After a few more hours of going over this I determined the root cause and now I simply do not understand how this was not a problem in dev instances or any other environments. This was a circular import issue. local_settings.py started with an import that fetched defaults from the app. from .se

Re: Database problem in Django

2014-06-19 Thread Stodge
Read the documentation: https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by On Wednesday, 18 June 2014 08:06:18 UTC-4, Ashu Singh wrote: > > Hello everyone. My doubt is how to fetch the recent two database entries > in django. User may enter into database anytime but the query s

Re: Database problem in Django

2014-06-18 Thread C. Kirby
You really need to show the models you are interested in this working on. In particular you will need the models to have a "created time" or something similar to order your query on. Kirby On Wednesday, June 18, 2014 7:06:18 AM UTC-5, Ashu Singh wrote: > > Hello everyone. My doubt is how to fet

Re: Database problem in Django

2014-06-18 Thread Glen Jungels
Erik is certainly right on this. All queries are point in time and in databases with large numbers of inserts per second, getting the true last two inserts will be relative to when the query starts. On Jun 18, 2014 9:33 AM, "Erik Cederstrand" wrote: > Den 18/06/2014 kl. 14.31 skrev Glen Jungels

Re: Database problem in Django

2014-06-18 Thread Erik Cederstrand
Den 18/06/2014 kl. 14.31 skrev Glen Jungels : > It will be different depending on the database (assuming you are asking about > the query only). You will need to do an order by on either your auto > incremented field or dat field plus something like a limit 2 (Postgres and I > believe MySQL) o

RE: Database problem in Django

2014-06-18 Thread Glen Jungels
It will be different depending on the database (assuming you are asking about the query only). You will need to do an order by on either your auto incremented field or dat field plus something like a limit 2 (Postgres and I believe MySQL) or top 2 for something like SQL Server. On Jun 18, 2014 8:1

RE: Database problem in Django

2014-06-18 Thread Ilya Kazakevich
You probably need to have "insert_date" field and store entry created date there. Ilya Kazakevich, JetBrains PyCharm (Best Python/Django IDE) http://www.jetbrains.com/pycharm/ "Develop with pleasure!" >-Original Message- >From: django-users@googlegroups.com >[mailto:django-users@google

Re: Database Error (SQLite) Database is locked

2014-03-28 Thread Kelvin Wong
You can try finding the lock (assuming you are on unix): $ which fuser /usr/bin/fuser $ fuser db.sqlite3 db.sqlite3: 84349 $ ps aux | grep 84349 kelvin 84349 0.0 0.1 491220 4776 ?? SFri03PM 3:24.57 /Applications/SQLite Database Browser.app This shows candidates that might ha

Re: Database Error (SQLite) Database is locked

2014-03-28 Thread willy Hakizimana
I know this might be stupid question. Did you syncdb after you installed it? On Friday, March 28, 2014 8:22:33 AM UTC-5, KEVIN HUNGAI wrote: > > Hi all am using django-registration app in one of my projects and sqlite3 > for the database. I keep getting Database Error (SQLite) Database is > lo

Re: database design problem.

2014-03-15 Thread Lachlan Musicman
I would make the imports model an "intermediate model" - see here: https://docs.djangoproject.com/en/1.6/topics/db/models/#extra-fields-on-many-to-many-relationships L. On 16 March 2014 09:41, willy Hakizimana wrote: > Thank you guys so much. You guys rock! > > > On Saturday, March 15, 2014 10:

Re: database design problem.

2014-03-15 Thread willy Hakizimana
Thank you guys so much. You guys rock! On Saturday, March 15, 2014 10:38:03 AM UTC-5, willy Hakizimana wrote: > > First of all, this community is amazing at how fast questions are > answered. I have learned so much. > > > I am designing an app with models that look like this. > > Country(country_

Re: database design problem.

2014-03-15 Thread Alvin Lindstam
Actually, the Django term for this is "through". Not via. See https://docs.djangoproject.com/en/1.6/topics/db/models/#extra-fields-on-many-to-many-relationships on how to specify the intermediate table to be used in many-to-many relationships. Den lördagen den 15:e mars 2014 kl. 18:01:02 UTC

Re: database design problem.

2014-03-15 Thread Larry Martell
On Sat, Mar 15, 2014 at 9:38 AM, willy Hakizimana wrote: > First of all, this community is amazing at how fast questions are answered. > I have learned so much. > > > I am designing an app with models that look like this. > > Country(country_id(PK), country_name, gdp, gdp_growth, income_per_capita

Re: Database operators for custom fields

2014-02-20 Thread Johannes Schneider
thnx, yea that's what I'm looking for. unfortunately I cannot use 1.7 ;( bg, Johannes On 19.02.2014 23:19, Anssi Kääriäinen wrote: If I am not mistaken you are trying to alter how .filter(customfield__eq=val) and friends work. In current Django versions you can't easily customize the SQL gener

  1   2   3   4   5   6   >