Project layout

2017-04-14 Thread Rich Shepard
assume the topmost one is the Django project name, but what is the second one? If I want to invoke the application using 'edb' as the application name, which directory needs to be renamed? Looking forward to learning, Rich

Project layout

2017-04-14 Thread Rich Shepard
y with the same name. I assume the topmost one is the Django project name, but what is the second one? If I want to invoke the application using 'edb' as the application name, which directory needs to be renamed? Looking forward to learning, Rich

First models.py needs tuning

2017-04-18 Thread Rich Shepard
ching me how to write this. If you would be willing to look at the module, show me how to write the two conditions above, and check syntax on the all 5 classes in it I will send you the file off the mail list. Rich

Re: First models.py needs tuning

2017-04-18 Thread Rich Shepard
ances/#django.db.models.Model.clean Mike, I'll read how to use these. Thanks, Rich

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
;, 'person', 'proj_nbr') Use the model's clean() method ... https://docs.djangoproject.com/en/1.8/ref/models/instances/#django.db.models.Model.clean This I'll need to ponder more to figure out where to put the clean method so it validates entries before they're saved. Thanks, Rich

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
hods after I get the multi-variable PKs correct. Another place I sometimes use is the save() method. Django also provides pre_save and post_save hooks so you never need to use database triggers. This goes beyond what I've learned. I'll get there step-by-step. Yes, you are helping me smooth off the rough spots. Thanks, Rich

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
on? When I want to limit acceptable strings in a data entry field to a provided list, as in postgres's check constraint? Is Mike's suggestion of clean() the way to handle these? Thanks very much, Rich

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
ll specify unique_together() for the columns that would have comprised the PK? Regards, Rich

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
ell as higher-level validation in Python. As I thought. I did not think of adding the UNIQUE constraint to the appropriate fields, but will. Many thanks, Rich

'migrate' does not find existing postgres database

2017-06-26 Thread Rich Shepard
;: 'rshepard', 'PASSWORD': '', 'HOST': '', 'PORT': '5432', } } Again, this is for my use and the database with its existing tables lives in the same cluster with all my other databases. And, each table will be a separate app; the models have been translated from sql to django. I'd appreciate suggestions on how to proceed. Rich

Re: 'migrate' does not find existing postgres database

2017-06-26 Thread Rich Shepard
he default settings.py and changed the db name without noticing that it does not need the default path in the file. Thanks, Rich

Adding a lookup table

2017-06-28 Thread Rich Shepard
in django (1.11.2 currently installed). Pointers to the appropriate docs much appreciated. Rich

Re: Adding a lookup table

2017-06-28 Thread Rich Shepard
bit more research, then add the name to the appropriate county list. Example, Drewsey in Grant Co. Do all cities cleanly break into one county? As far as I know, yes. At least in OR, WA, ID, NV, UT, WY, and MT. Some cities are counties, I believe, and in New York City each borough is a separate county. Thanks, Rich

Re: Adding a lookup table

2017-06-28 Thread Rich Shepard
On Wed, 28 Jun 2017, Rich Shepard wrote: appropriate county list. Example, Drewsey in Grant Co. Oops! Drewsey is in Harney Co. Mea culpa! Rich

Re: Adding a lookup table

2017-06-29 Thread Rich Shepard
On Wed, 28 Jun 2017, Rich Shepard wrote: Yes, that's the way to do it. I wrote my first idea before realizing that two models/tables would be the way to go. After further consideration I realized that a single model/table is the way to go. Because each city needs to be associated w

Pre-loading static data into database table

2017-06-29 Thread Rich Shepard
city_name,county_name) VALUES ('Bend','Dechutes');") repeated for each row in the table (easy to do with emacs)? And, can I put this code in models.py after the classes? Rich

Re: Pre-loading static data into database table

2017-06-29 Thread Rich Shepard
ently exist in the database. If the above is the preferred solution with an existing table, then to add the table and date I can use the psql shell to read the file. Thanks very much for clarifying, Rich

Re: First models.py needs tuning

2017-06-29 Thread Rich Shepard
x27;, 'Business, other', 'Chemicals', 'Energy', 'Law'). In postgres SQL this would be a constraint check. How do I write this in a django Model.clean or its relatives? Rich

Re: First models.py needs tuning

2017-06-29 Thread Rich Shepard
7;), ('Law'), ('Manufacturing'), ('Mining'), ('Municipalities'), ('Ports/Marine Services'), ('Transportation'), ) industry=models.CharField(max_length=24, choices=industry_choices, default='Agriculture') Thanks, Rich

Re: First models.py needs tuning

2017-06-29 Thread Rich Shepard
key-value pair, where the first item is the key (literally is the value that is saved on the DB field), and the value is the "display value". Guilherme, I missed the first sentence when I looked at the page. Your third paragraph explains the syntax very clearly. I'll change the code to comply. Thanks very much, Rich

Re: The best database for django

2017-07-10 Thread Rich Shepard
#x27;s F/OSS, enterprise-class, suitable for a single user, and has outstanding support on the maillists. I've used it for 20 years and am now running version 9.6.3 for my own (and client) applications. Rich

Defining project apps

2017-07-11 Thread Rich Shepard
use, a client relation management application (which will go to github when done). I want to avoid name conflicts with app names so my first inclination is to define one app as data and another as reports. Please suggest appropriate app names if these would be problematic. Rich

Re: Defining project apps

2017-07-11 Thread Rich Shepard
ds so variables, classes, attributes, etc. do not use those names. If Django has no issues with naming apps 'client_data' and 'reports' I'll use those names because they clearly express their purpose. Thanks, Rich

Retroactively seting up virtualenv

2017-07-14 Thread Rich Shepard
the SlackBuilds.org packages. My question is how to migrate both django and my project to the new virtual environment. Rich

Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Dear All, I'm new to the Django ORM, and quite new to ORMs in general. I have two models (lets call them A and B) between which I have an interesting mapping. There are precisely 2 B instances associated with each A instance. Each A instance can have many B instances. The order of Bs are i

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Oops sorry I meant every B instance can have multiple A instances. Sorry! On Thursday, 30 July 2015 16:21:37 UTC+1, monoBOT monoBOT wrote: > > > 2015-07-30 16:08 GMT+01:00 Rich Lewis >: > >> There are precisely 2 B instances associated with each A instance. Each >>

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Hi Tom, That was approximately what I was planning to do, I shall do some experimenting to see if I can do any more. I was just wondering if there was a clever feature for this sort of thing, as ORMs seem pretty magic already! Thanks, Rich On Thursday, 30 July 2015 17:15:40 UTC+1, Tom Evans

Announcing Django-Zappa - Serverless Django on AWS Lambda + API Gateway

2016-02-08 Thread Rich Jones
here: https://gun.io/blog/announcing-zappa-serverless-python-aws-lambda/ Watch a screencast here: https://www.youtube.com/watch?v=plUrbPN0xc8&feature=youtu.be And see the code here: https://github.com/Miserlou/django-zappa Comments, questions and pull requests are welcome! Enjoy, Rich Jones

Extending Form to include 'placeholder' text

2016-03-22 Thread Rich Rauenzahn
Hi, I'd like to make a mixin to set the placeholder text in the widget attrs. Reading this https://code.djangoproject.com/ticket/5793, it seems that extending Meta for custom fields is somewhat discouraged. Would the following be the recommended way to do it? Just adding a class variable to t

Absurdly long queries with Postgres 11 during unit tests

2021-06-07 Thread Rich Rauenzahn
This is heads up in case anyone sees something similar: I have managed to trigger this degenerate query case in two completely different Django 2.2 projects. In production with a normal sized dataset, the query time is fine. But during unit testing with a small subset of the data, the querie

Migrations appear to run twice when running tests

2019-11-19 Thread Rich Rauenzahn
about the migration process to know what to look for. ...I'm surprised it even works given that the database is already migrated once -- shouldn't the 2nd migrations fail? I'm not expecting an answer -- I think there's not enough information. But where should I dig? Rich

Influencing order of internal migration operations

2019-12-11 Thread Rich Rauenzahn
then sort the operations by this priority before they are emitted into a migration.py. Or any other ideas to make this a bit more seamless? Rich -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and sto

make ££££ this is the real deal

2007-10-20 Thread Rich money maker
t, the more money you make - as well as everyone else on the list! In this situation your job is to let as many people see this letter as possible. So they will make you and me rich You can even start posting the moment your email is confirmed. Payments will still appear in your PayPal account even

<    1   2