Re: Advice on python version for new project

2016-08-16 Thread Rich Shepard
On Tue, 16 Aug 2016, Avraham Serour wrote: https://virtualenv.pypa.io/en/stable/ Thanks, Avraham. Looks interesting. Rich

Advice on python version for new project

2016-08-15 Thread Rich Shepard
The django web site suggests that new projects use python3 unless required dependencies are not yet available for that version. I've no idea what python dependencies I'll need for this job. What I want to do is convert an abandoned php application (last upgraded a decade ago) to django. The

Re: Advice on python version for new project

2016-08-15 Thread Rich Shepard
On Mon, 15 Aug 2016, Nick Santos wrote: I'd recommend Python 3 at this point unless you encounter a good, specific reason to use Python 2. Nick, I'll take your advice. I have both -2.7.5 and -3.5.2 installed. Using pip to install django puts it in only the 2.7.5/site/packages/

Re: Advice on python version for new project

2016-08-15 Thread Rich Shepard
On Mon, 15 Aug 2016, Rich Shepard wrote: I'll have to learn how to get it to install in -3.5.2, too. Found the answer: pip3. Rich

Re: Advice on python version for new project

2016-08-15 Thread Rich Shepard
On Mon, 15 Aug 2016, Ari Davidow wrote: If you're doing a CRM app, many advantages to using Python 3 and not having to deal with 2's Unicode issues. Ari, This is for my use only. I've outgrown the tools I've been using for my consulting business and need to consolidate them in a single

Starting new project -- version 1.10

2016-08-19 Thread Rich Shepard
I'm working my way through the tutorial and creating the application I want rather than the articles example. I've become stuck between two sections of the tutorial. Creating the project (section 2.3.1 worked fine from the TLD, ~/development/: django-admin startproject crm created

Re: Advice on python version for new project

2016-08-15 Thread Rich Shepard
On Tue, 16 Aug 2016, Avraham Serour wrote: you should also create a virtualenv for the project Avraham, OK. Please point me to some docs for this. Regards, Rich

Re: Starting new project -- version 1.10

2016-08-19 Thread Rich Shepard
On Fri, 19 Aug 2016, Tim Graham wrote: Don't use the same name for your app and project. When you "startproject crm", the project settings.py, urls.py, and wsgi.py are placed in a module named "crm" so you can't use the same name for an app. Tim, I read that but overlooked the

Re: Starting new project -- version 1.10

2016-08-22 Thread Rich Shepard
On Mon, 22 Aug 2016, Michal Petrucha wrote: Just to add to what Tim wrote, there's no reason why you couldn't use the crm package created by startproject as an “app”, too – all you have to do is create a models.py file in there (next to the existing urls.py, if you need any models), views.py

DateField default value

2016-08-22 Thread Rich Shepard
Reading the doc for DateField() I tried to set the default as today's date, but 'default=date.today' is not accepted. If there is a way to set today's data as the default for a DateField() please point me to the doc for it. Thanks, Rich

Re: DateField default value

2016-08-22 Thread Rich Shepard
On Mon, 22 Aug 2016, Tim Graham wrote: What do you mean by "not accepted"? Is there some error message? What you wrote should work as far as I know. Tim, Yes, there was an error message that was not saved. from datetime import date That's probably the cause: my missing that import in

Re: Project time and expense tracking [RESOLVED]

2016-09-02 Thread Rich Shepard
On Fri, 2 Sep 2016, Rich Shepard wrote: I'll definitely look at the project management packages. It appears that django-timepiece will fulfill my needs. Thanks again, Rich

less-css

2016-09-02 Thread Rich Shepard
The django-timepiece project requires a tool called 'less,' a css preprocessor. However, on linux systems (if not also other unices) /usr/bin/less is a pager with greater capabilities than more. Is there a conflict between these two? Where would the css-less be installed? TIA, Rich

Re: less-css

2016-09-02 Thread Rich Shepard
On Fri, 2 Sep 2016, Aron Griffis wrote: There isn't a conflict between them, because the LESS compiler installs as "lessc" and also because you'll want to install it locally using npm rather than system-wide. These links might be helpful to you:

Re: Project time and expense tracking

2016-09-02 Thread Rich Shepard
On Fri, 2 Sep 2016, Tim Graham wrote: I see some results by searching "django time tracking app" in a search engine. In particular, Django Packages has a nice comparison of some options: https://djangopackages.org/grids/g/project-management/ Tim, That's a much better search string than

Project time and expense tracking

2016-09-01 Thread Rich Shepard
Before I re-invent the wheel, does anyone know of an existing django project time and expense application using sqlite3? Now and then a client needs to be invoiced by time and expense rather than a flat rate. My financial software is supposed to do this, but I've never been able to convert

Django documentation release 1.10.1a1

2016-08-30 Thread Rich Shepard
I don't know how this PDF displays in other viewers, but in xpdf, mupdf, and acroread important strings in the text are very difficult to read because they have very low contrast with the white background. For example, comments are in a light grey and important strings are in a very pale

Re: Django documentation release 1.10.1a1

2016-08-30 Thread Rich Shepard
On Tue, 30 Aug 2016, Tim Graham wrote: I don't think there have been any recent changes to the styling, but if you'd like to contribute, the place to look is probably https://github.com/django/django/tree/master/docs/_theme. Tim, I don't know what to do once I'm on that page but when time

Using version control with django

2016-08-23 Thread Rich Shepard
I want to track django projects with subversion. (Single developer, local, so svn is better suited than the distributed git and mercurial.) I'd like advice on how to lay this out vis-a-vis the django layout. Project overall root is ~/development/crm-project. This directory contains:

Re: Using version control with django

2016-08-23 Thread Rich Shepard
On Tue, 23 Aug 2016, Gergely Polonkai wrote: On the other hand, you definitely should choose a distributed version control if you are working alone. For example, Git, Mercurial and Fossil repositories are self contained, which means the whole development history is located right where you work.

Re: Using version control with django

2016-08-23 Thread Rich Shepard
On Tue, 23 Aug 2016, Gergely Polonkai wrote: You should put all the stuff under trunk/, so it becomes trunk/manage.py, trunk/crm/, etc. If you are developing for multiple customers, the branches and tags directory may come in handy later. Also, it's nothing but naming convention: you can call

Re: Using version control with django

2016-08-23 Thread Rich Shepard
On Tue, 23 Aug 2016, François Schiettecatte wrote: I would add a +1 for git, I started off with svn and switched to git, branching and merging is much easier which really helps when you want to test ideas. François, Thanks for your insight, Rich

Re: Starting new project -- version 1.10

2016-08-23 Thread Rich Shepard
On Tue, 23 Aug 2016, Carsten Fuchs wrote: I cannot remember where is was stated, but iirc another reason for the “project-under-the-project” subdirectory was that it is considered not as app, but rather as “site”. Carsten, Thanks for the clarification. That helps. Rich

Re: Starting new project -- version 1.10

2016-08-23 Thread Rich Shepard
On Tue, 23 Aug 2016, Michal Petrucha wrote: This is mostly an issue with how we name things. You have a project, which is a CRM application. That's the entire thing, which consists of a bunch of different Python packages. So, each of the subdirectories in the top-level “clientmanagement”

Clarifying Project vs Apps

2016-08-24 Thread Rich Shepard
While I think that I understand the differences between a project and its apps there remains one point of uncertainty. I've not found the answer, although it might be in the 1.10 docs or on the Web and I've missed it. If the project represents the entire database, do the apps represent

Re: Clarifying Project vs Apps

2016-08-24 Thread Rich Shepard
On Wed, 24 Aug 2016, Lee Hinde wrote: My tuppence. Lee, Before or after Brexit? The value might change. :-) No, an app is a logical grouping of objects/tables. You might, for instance,have an Invoice app that would include an Invoice table (model) and a LineItems table. Products and

Re: Clarifying Project vs Apps

2016-08-24 Thread Rich Shepard
On Wed, 24 Aug 2016, Lee Hinde wrote: So, no one is going to grade it. You're making this for yourself, so I wouldn't over think it. I'm working on a project now that only has two apps, one with all the core models and one for utility models (like choice lists).(I'm using several packages, so

Re: Clarifying Project vs Apps

2016-08-24 Thread Rich Shepard
On Wed, 24 Aug 2016, Andreas Kuhne wrote: If you know how your project will be used, you can usually group the models and views in logical apps. For example a customer app that has the customer (user) model, address model. Then another app for orders and invoices and so on. Andréas, Here

Re: Clarifying Project vs Apps

2016-08-24 Thread Rich Shepard
On Wed, 24 Aug 2016, Andromeda Yelton wrote: My feeling/practice on apps is: each app is a one-word informative noun. It contains the models that are logically grouped under that noun (and the views, urls, etc required to interact with those models on the front end). Andromeda, So are

Convert PostgreSQL tables to django

2016-10-29 Thread Rich Shepard
Is there a tool to convert postgres DDL to django model syntax? It would sure save a lot of time and effort if there is a converter. Rich

Re: Convert PostgreSQL tables to django

2016-10-29 Thread Rich Shepard
On Sat, 29 Oct 2016, m1chael wrote: https://docs.djangoproject.com/en/1.10/howto/legacy-databases/ I missed seeing that. Thanks very much. Rich

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
On Wed, 19 Apr 2017, Mike Dewhirst wrote: You probably need a single FK plus a meta option of unique_together https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together Mike, Okay. What would be the correct syntax for PRIMARY KEY unique_together=('company', 'person',

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
On Fri, 21 Apr 2017, Mike Dewhirst wrote: In the more usual scenario you specify your models using Python and let the Django ORM framework do the SQL. If that is your case ... Mike, I wrote the schema for postgres but had not created the database. So I renamed the file models.py and

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
On Fri, 21 Apr 2017, Michal Petrucha wrote: I have bad news for you – Django does not at this point in time have support for multi-column primary keys. A large part of the ORM is built around the assumption that each model instance is identified by a single field acting as its primary key.

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
On Fri, 21 Apr 2017, Michal Petrucha wrote: For the foreseeable future, though, I'd strongly recommend that you save yourself a lot of trouble, and just add a surrogate primary key field to all your tables and models. Michal, I'll let Django do this. However, should I still specify

Project layout

2017-04-14 Thread Rich Shepard
As a Django newcomer I'm still confused about project layout naming conventions. Following the author's layout in '2 Scoops' chapter 3 for a project I'm building for my own use to manage prospects and clients, I ran cookiecutter pointing to pydanny's cookiecutter-django. I have several

How to structure this django application

2017-04-07 Thread Rich Shepard
Caveat: I'm not a professional coder or web developer, but have written many applications over the years. Because I'm also new to django I need insights into how to structure an application application supporting multiple users, each in its own private section. This application will allow my

Re: How to structure this django application

2017-04-07 Thread Rich Shepard
On Sat, 8 Apr 2017, Sithembewena Lloyd Dube wrote: My best recommendation for structuring Django projects (and for optimization and a myriad other goodies) would be the book Two Scoops of Django by Daniel and Audrey Roy Greenfeld. I could say a lot but the bottom line is, check the book out.

Re: How to structure this django application

2017-04-08 Thread Rich Shepard
On Sat, 8 Apr 2017, Sithembewena Lloyd Dube wrote: Do take the time to peruse the book. It would be time well spent. Also, do keep in mind that the recommendations therein do not apply to a Django blog or CRM sustem etc, per se. They would apply just as well if you were building a RESTful

Project layout

2017-04-14 Thread Rich Shepard
As a Django newcomer I'm still confused about project layout naming conventions. Following the author's layout in '2 Scoops' chapter 3 for a project I'm building for my own use to manage prospects and clients, I ran cookiecutter pointing to pydanny's cookiecutter-django. I have several

First models.py needs tuning

2017-04-18 Thread Rich Shepard
Converting from the postgres schema to a Django models.py for my first Django project. Most of the syntax (64 lines in the file) should be correct, but there are two conditions that I have not found how to handle. First, a couple of classes have primary keys with three fields. I know there's

Re: First models.py needs tuning

2017-04-18 Thread Rich Shepard
On Wed, 19 Apr 2017, Mike Dewhirst wrote: You probably need a single FK plus a meta option of unique_together https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together Use the model's clean() method ...

Defining project apps

2017-07-11 Thread Rich Shepard
My background is database applications, not web site, development so I have started my first django-1.11.3 project by defining the database schema and defining the classes in models.py. Now I want to define the app based on this file and am not sure how to name it. This project is for my own

Re: Defining project apps

2017-07-11 Thread Rich Shepard
On Tue, 11 Jul 2017, yingi keme wrote: I don't think you will have any app conflicts if you give them names applying to the content of the app or any other name that suites you best. Yingi, I want to avoid Django reserved words if any exist. Both python and SQL have reserved words so

Re: The best database for django

2017-07-10 Thread Rich Shepard
On Mon, 10 Jul 2017, DEIBER ANDRES RINCON ROJAS wrote: Hi to everybody, I'm developing an web application using Python and Django and it requires storage of excel data, data volume high and still I don't have a clear idea about what database manager implement, Could anyone help me with some

Retroactively seting up virtualenv

2017-07-14 Thread Rich Shepard
My business is not web site development and I'm starting development of a django project for my own use. Django-1.11.3 is installed in /usr/lib/python3.6/site-packages/django and my project is located in / ~/development/clientmgntsystem_project/. I had no issues the last time I ran 'python

Pre-loading static data into database table

2017-06-29 Thread Rich Shepard
Reading tells me that runSQL allows arbitrary SQL to run on the database ... except for the postgres backend: "On most database backends (all but PostgreSQL), Django will split the SQL into

Re: Pre-loading static data into database table

2017-06-29 Thread Rich Shepard
On Thu, 29 Jun 2017, John Thomas wrote: 419 is not that many. I'd probably do that via a Python shell. import models.Cities for item in lists_of_lists_of_419 temp = Cities(city+name=item[0], county_name=item[1]) temp.save() John, I should have mentioned that the table does not currently

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

Re: Adding a lookup table

2017-06-28 Thread Rich Shepard
On Wed, 28 Jun 2017, John Thomas wrote: Could you create a City model and a County model and relate them one County to many Cities? I'm not sure how to populate those tables. John, Yes, that's the way to do it. I wrote my first idea before realizing that two models/tables would be the way

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: First models.py needs tuning

2017-06-29 Thread Rich Shepard
On Wed, 19 Apr 2017, Mike Dewhirst wrote: Second, I have a couple of fields with postgres check constraints; that is, valid data is restricted to a list of strings. I've not found a Django model field validator teaching me how to write this. Use the model's clean() method ...

Re: First models.py needs tuning

2017-06-29 Thread Rich Shepard
On Thu, 29 Jun 2017, Guilherme Leal wrote: It wouldn't be the case to use the field choices? https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.Field.choices Guilherme, Now that I know Field.choices exists it will certainly do the job. I read the example as

Re: First models.py needs tuning

2017-06-29 Thread Rich Shepard
On Thu, 29 Jun 2017, Guilherme Leal wrote: "An iterable (e.g., a list or tuple) consisting itself of iterables of exactly two items" I don't think that constructing choices as a "iterableof 1 item iterables" will work. Think of each item in the choices iterables as a key-value pair, where the

Adding a lookup table

2017-06-28 Thread Rich Shepard
I want to add a lookup table to my application. The table will have two columns: city_name and county. This will allow me to return all rows for companies in a specific county (or all companies sorted by county). I know how to do this with SQL and want to learn how to implement this capability

Re: First models.py needs tuning

2017-04-21 Thread Rich Shepard
On Fri, 21 Apr 2017, Michal Petrucha wrote: If you want to be able to gracefully handle violations of those constraints, and produce more meaningful error messages (for example, when validating a form that processes one of these models), you'd also implement those checks in Python, either in

Re: 'migrate' does not find existing postgres database

2017-06-26 Thread Rich Shepard
On Mon, 26 Jun 2017, Vijay Khemlani wrote: Maybe I'm misunderstanding, but you don't access PostgreSQL databases as normal files with a path. If you were using SQlite that might work, but not on typical SQL databases (MySQL, Postgres, etc) Vijay, That would do it. I took the default

'migrate' does not find existing postgres database

2017-06-26 Thread Rich Shepard
This is my first django project and is intended for my own use, but I'll put it on git-hub when it's working. The database backend is postgresql-9.6.3 and exists in /var/www/htdocs/. When I run 'python3 manage.py migrate' django looks for the database in ~/development/crm_project/crm/ and

Testing

2018-01-14 Thread Rich Shepard
I've not received messages from this mail list since last summer. I now have a need to communicate with others and learned that I'm still subscribed so I want to learn if this message posts and is sent back to me by the MLM. Rich -- You received this message because you are subscribed to the