Re: Can't create editable foreign key field in Django admin: going to give up on django

2016-09-12 Thread Mike Dewhirst
On 13/09/2016 3:02 PM, Hanh Kieu wrote: Hey guys, I'm creating a translation app that allows you to translate from one object to the other. My translation model has two foreign keys that links to two words, and on the admin site I want the Admin to be able to input two different words. The word

Re: Import css in Django

2016-09-11 Thread Mike Dewhirst
Mike On 12/09/2016 1:58 AM, Jonathan Cheng wrote: thx reply,but it just can see the original html with no css,is my path setted correct? ludovic couesæ–¼ 2016å¹´9月11日星期日 UTC+8ä¸‹å ˆ11時45分24ç§’å¯«é “ï¼š Have you tried to add a few newlines to be sure about which line is

Re: Recipe to upgrade to Python 3.x on Ubuntu 12.04 and 14.04

2016-09-08 Thread Mike Dewhirst
a bit of effort in a new Ubuntu 16.04 machine. But I would prefer a lovely easy recipe to bring Python 3.5 to both my existing servers being 12.04 staging and 14.04 production. Thanks Erik Mike Erik -- You received this message because you are subscribed to the Google Groups "Django

Re: Recipe to upgrade to Python 3.x on Ubuntu 12.04 and 14.04

2016-09-07 Thread Mike Dewhirst
On 7/09/2016 6:49 PM, James Schneider wrote: On Sep 6, 2016 10:44 PM, "Mike Dewhirst" <mailto:mi...@dewhirst.com.au>> wrote: > > I'm looking for a step-by-step system admin recipe to get away from Python 2.7 because unicode on 2.7 is doing my head in. This is ugl

Recipe to upgrade to Python 3.x on Ubuntu 12.04 and 14.04

2016-09-06 Thread Mike Dewhirst
gested strategies or advice? The sole objective is to retire Python 2.7. There are no Django third party app requirements for Python 2.7. Haven't looked at Buildbot or Trac yet. Thanks folks Mike -- You received this message because you are subscribed to the Google Groups "Django

Re: How to Let a User add a Video not a image as a post?

2016-09-01 Thread Mike Dewhirst
On 2/09/2016 12:53 AM, djangorobert wrote: I have researched this issue with django for years now and seems that no body in the django community knows how to do this which is a suprise because there are many smart people but not one has been able to solve this mystery? What i'm aiming for is

Re: A tricky query in one to many relationship - atleast for me:)

2016-08-29 Thread Mike Dewhirst
On 30/08/2016 4:33 PM, Web Architect wrote: Hi, I am looking for an elegant and efficient mechanism to have a query filter or a solution for the following one to many relationship model. Please note the following is just an illustration of the models - hope it should provide what I am looking

Re: Running Django Project Locally

2016-08-24 Thread Mike Dewhirst
ango.db.backends.sqlite3", "NAME": ":memory:", "USER": "", "PASSWORD": "", "HOST": "", "PORT": "", } } You can probably find where the settings are b

Re: Running Django Project Locally

2016-08-24 Thread Mike Dewhirst
launch the software. | Good luck Mike The file structure is something like this: Project Name app1 app2 app3 app4 app5 models.py forms.py __init__.py urls.py views.py admin.py Each app contains the following: models.py forms.py __init__.py urls.py views.py admin.py -- You received this

Re: Using version control with django

2016-08-23 Thread Mike Dewhirst
On 24/08/2016 10:19 AM, Rich Shepard wrote: On Wed, 24 Aug 2016, Mike Dewhirst wrote: I use svn too. I hope git is a passing fad. Mike, Since Linus developed it for the kernel devs when BitKeeper became proprietary I very much doubt it's a passing fad. From all I've read, Git is

Re: Using version control with django

2016-08-23 Thread Mike Dewhirst
ssing fad. My entire project is in trunk and I always deploy to the staging server directly from trunk I work on the project in the "mike" branch and that's what is used by the dev server I merge from mike into trunk and test before deploying to staging When comfortable, I

Re: DateField default value

2016-08-22 Thread Mike Dewhirst
On 23/08/2016 9:03 AM, Rich Shepard wrote: 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. https://docs.djangoproj

Re: Using the Django ORM in a long-running worker process

2016-08-19 Thread Mike Dewhirst
We saw a presentation last weekend at pyconau by Andrew Godwin about Django Channels and you might like to check the YouTube video. It lets long-running processes keep web sockets open in parallel with http requests. Connected by Motorola Daniel Tao wrote: >Thank you for the thorough response

Re: Trying to use Django 1.9.5, django_pyodbc, MS SQL Server 2012 on 64bit Windows 7

2016-08-10 Thread Mike Dewhirst
t an answer to your specific question but a recommendation to use PostgreSQL instead. It works brilliantly on Windows and makes life serene. Much easier to gain python and django experience when the environment isn't fighting back. You can dump and pump later when you really need SQL Serv

Re: Django Multiple Currencies Implementation

2016-08-08 Thread Mike Dewhirst
On 8/08/2016 4:31 PM, Ali khan wrote: Thank you mike for your kind reply but question was more related to how to setup moneyfield using what available modules. Use case is that a payment processor should be able to determine exchange value for instance if price is listed in Asian currency and

Re: Django Multiple Currencies Implementation

2016-08-07 Thread Mike Dewhirst
would most likely choose just one stable currency and force all buyers to pay in that currency. Probably not answering your question but I hope that helps Mike Regards, Ali On Sun, Aug 7, 2016 at 3:01 PM, Babatunde Akinyanmi mailto:tundeba...@gmail.com>> wrote: Hello Khan, Y

Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-27 Thread Mike Dewhirst
d at that moment. And DB should not has deleted instance any more. I have double checked the Django code and can say that Django send that signal just before transaction is committed. Is this a Django bug? Is it the same for post_save? Mike So technically instance should be inside DB for Hibe

Re: template include for Django 1.8

2016-07-14 Thread Mike Dewhirst
emplate vs. having them included via the template tag. Did you examine the rendered output that was being sent to your PDF generator? No I didn't. I will do so. I sometimes give in too easily. Cheers Mike -James -- You received this message because you are subscribed to the Google Group

Re: template include for Django 1.8

2016-07-14 Thread Mike Dewhirst
On 14/07/2016 4:53 PM, James Schneider wrote: On Jul 13, 2016 6:54 PM, "Mike Dewhirst" mailto:mi...@dewhirst.com.au>> wrote: I need to include the contents of a css file in my template [1] The css content needs to exist within and </pre></blockquote><pre styl

template include for Django 1.8

2016-07-13 Thread Mike Dewhirst
template but that way madness lies! {% include %} exists but seems designed for other templates. And I can't find it in the docs. Is there a way to include the content of a css file? Thanks Mike [1] without using the normal href="{{STATIC_URL}}styles.css" /> -- You re

Re: Newbie question regarding uninstalling Django system-wide.

2016-07-12 Thread Mike Dewhirst
On 13/07/2016 1:55 AM, Leo wrote: I am learning how to use Django. With my first attempt I did not use a virtual environment instead installed Django system-wide. Now I have learned to utilize virtual environments. Can you help me learn how to uninstall the system-wide Django instance? Also, I ca

Re: How can I change the TabularInline "title" on Django Admin?

2016-07-07 Thread Mike Dewhirst
On 8/07/2016 2:56 AM, Fellipe Henrique wrote: Hello, When we need to use TabulerInline on Django Admin, the admin template create a "title" for the field... it's not the verbose_name... verbose_name is set like a Group.. "Blue" line before TabularInline... after this line, we have a table title.

Re: pywkhtmltopdf [Was: [mezzanine-users] Re: Images in .pdf Invoice]

2016-07-06 Thread Mike Dewhirst
Akhil thank you. I'll bookmark your advice for later. At this point staying with a functional view might be less work. Next views to be written will probably be class based Cheers Mike Akhil Lawrence wrote: >To answer  how do I change from function based views to class based views,

Re: Installing Django Problem.

2016-07-03 Thread Mike Dewhirst
quite a few third party tutorials on the web. Good luck Mike On Sun, Jul 3, 2016 at 9:32 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: On 4/07/2016 12:01 PM, Steve Burrus wrote: well I uyet again am encountering problems with installing the Django

Re: Installing Django Problem.

2016-07-03 Thread Mike Dewhirst
Therefore the short answer to your question is ... (stevesenv) C:\Users\sbur87\Desktop\steves_dir\stevesenv>pip install django Cheers Mike but where exactly do I go from here in installing django? Man y thanx to anyone who can help me with this "trying" problem of mine. -- You rec

pywkhtmltopdf [Was: [mezzanine-users] Re: Images in .pdf Invoice]

2016-06-28 Thread Mike Dewhirst
- which BTW I don't want to do. Thanks Mike On Friday, 24 June 2016 20:13:05 UTC+10, Joseph Mohan wrote: Any other things i'm missing with regards to getting an image into the .pdf invoices? Set the url to a full path Tried .png/.jpg Nothing... An

Re: Beginner question regarding virtualenv

2016-06-23 Thread Mike Dewhirst
On 24/06/2016 4:36 AM, Leo wrote: Hey Everyone, I’m a total newb to using Django and open stack. I am working on creating a Django development environment in a VMware environment/Ubuntu OS. Eventually I want to deploy this to production. The site’s purpose is as an intranet site. I have

Re: Django and jQuery, I don't get it

2016-06-09 Thread Mike Dewhirst
I can't help at all with jquery but IIRC there is a question in the Admin "Are you sure?" when you try deleting something from a list view. Might be a start Mike On 10/06/2016 1:06 AM, Olivier Dalang wrote: Hi ! I'm using several modules that rely on jQuery, and have so

Re: Django built-in: cycle

2016-06-05 Thread Mike Dewhirst
On 6/06/2016 9:39 AM, Mike Dewhirst wrote: On 6/06/2016 7:26 AM, Mark Cuevas wrote: I'm using the following, which works, but doesn't break properly. Â I'd like three across for each row. Â How can I accomplish that? {% for director in directors %} {{ dir

Re: Django built-in: cycle

2016-06-05 Thread Mike Dewhirst
to pad out your list or queryset of directors so it comes to mod(3) = 0 Use   for the one or two extras Then you can have three cells per row. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: CSS question for the Admin

2016-06-02 Thread Mike Dewhirst
On 2/06/2016 7:31 PM, Michal Petrucha wrote: On Thu, Jun 02, 2016 at 07:22:16PM +1000, Mike Dewhirst wrote: I have a varchar field of 300+ chars and I'd like to know how to provide space to wrap it on screen without resorting to a TextField Any CSS ideas? Thanks Mike Perhaps you

CSS question for the Admin

2016-06-02 Thread Mike Dewhirst
I have a varchar field of 300+ chars and I'd like to know how to provide space to wrap it on screen without resorting to a TextField Any CSS ideas? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Django Project Structure for mixins - best solution?

2016-06-01 Thread Mike Dewhirst
On 2/06/2016 12:54 AM, sevenrrain...@gmail.com wrote: I seen multiple project structure for Django, but they didn't discuss in detail about structuring mixins. I see that some people use mixins.py , others utils folder. Taking in consideration that I have many mixins for views(generic login,aut

Database router hints

2016-05-27 Thread Mike Q
ance. Am I going about this all wrong by saving a model to a particular db based on an instance's field? The idea is to have a staging version and a production version of a model instance in respective databases. Thanks, Mike -- You received this message because you are subscribed to th

Re: django tutorial part 2: clarification about INSTALLED APPS

2016-05-16 Thread Mike Dewhirst
On 17/05/2016 1:42 AM, Asi Dimbez wrote: Hi, I'm a newbie, there is thing not clear to me in the tutorial, part 2. I left part 1 with poll app working ok. In the tutorial, part 2, I read about INSTALLED_APPS :" That holds the names of all Django applications that are activated in this Django in

Re: how to use css in django 1.9

2016-05-13 Thread Mike Dewhirst
On 13/05/2016 3:37 PM, dk wrote: Â or what would be the best way to "print" the path for static? When I was starting out it was all quite difficult so I added the following to my (dev only) settings to reveal where all my directories were hiding ... BTW, dbhost below is a list of database h

Re: Fixtures won't load twice in same testcase

2016-05-05 Thread Mike Dewhirst
On 6/05/2016 8:42 AM, Rich Rauenzahn wrote: I've been tracing into django core code, and it looks to me that I have a case where the fixture has a auth.User(username=rich) with a pk=1 in the fixture. Â But sometimes as the User fixture with pk=1 is being added (updated?) through Model._save_tabl

Re: How and where should I put a version number in my Django project?

2016-05-03 Thread Mike Dewhirst
for storing it, but I would like to know good practices from other Django programmers, because I haven't found any. Have a look at Django itself in ../site-packages/django/__init__.py Mike Thank you in advance -- You received this message because you are subscribed to the Google Groups

Re: Integer field choice list keeps triggering migration

2016-05-03 Thread Mike Dewhirst
es in its definition. At any particular revision of your software there will be or might be different possible choices. So that means you can roll back to a different revision and get the correct choices for that revision. Mike class FactuurItem(models.Model): naam = models.CharField(ma

Re: Django StaticFiles

2016-04-28 Thread Mike Dewhirst
deny,allow Allow from all # show apache where to find static files Alias /static/ /var/www/static/xxdx/ Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-26 Thread Mike Dewhirst
On 26/04/2016 9:41 PM, Bruce Whealton wrote: Mike, Â Â Â Â Â So, I tried your idea for reorganizing the models, and just removed Organization and instead setup ContactOrOrganization as a class. Â It seemed to work ok, in terms of migrating fine. Â However, the database now lacks a

Re: A Problem about UnicodeEncodeError

2016-04-25 Thread Mike Dewhirst
is ... C:\Users\mike\env\ ... for all the projects I work on I use virtualenv to isolate the various development environments. Also I make sure there are no spaces in filenames or directory names and I only use ascii characters in filenames and directory names. mbcs characters in a path feels like

Re: Help with defining Models for ManyToMany and OneToMany relationships...

2016-04-23 Thread Mike Dewhirst
because I used related_name that way means nothing. You can connect contacts together or organizations together. Also, you can add other fields to Connection with which to describe the relationship. Mike I wanted to use the Organization as a foreign key on the Contact model. Â I could have

Re: A Problem about UnicodeEncodeError

2016-04-23 Thread Mike Dewhirst
Microsoft I consider to be something of a miracle! Move your project off the desktop and you won't need any workarounds. Mike It seems to be something to do with your PATH setting within Windows possibly containing some non-standard character. On Friday, April 22, 20

Re: In a new Model with a OneToOne(User) relationship, how to get the username?

2016-04-10 Thread Mike Dewhirst
ich does the same as get_name() and you wouldn't then bother with the name field. Also, it is possible that the Django User class has a get_name() method which you can call as required. You need to check that. Mike | The title says it all - this class is supposed to have a OneToOneFi

Re: Fabric - Someone has a fabfile to build a Sentry server?

2016-04-05 Thread Mike Dewhirst
On 6/04/2016 4:54 AM, Neto wrote: I need to build a server using nginx to run sentry, I needed a routine to install all the necessary packages, and configure the server. I am using Ubuntu, Nginx, Django. Have a look at Mezzanine - it comes with a fabric file to install and maintain Nginx, Guni

Re: How use model objects in ver1.9 WITHOUT an app and get rid off "Model class doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS." error mssg?

2016-04-04 Thread Mike Dewhirst
PPS entries just like a search path added to the BASE_DIR so it can find your models. If you don't want the app name in your table name in the database I believe you can specify the db_table in your model meta options Mike Thanks, Chris -- You received this message because you are subsc

Re: Migrating older 1.4 project to 1.9

2016-04-04 Thread Mike Dewhirst
Larry I saw that after I sent it and thought .. just as well I signed my name after the apology. Mike On 4/04/2016 11:15 PM, Larry Martell wrote: On Sun, Apr 3, 2016 at 7:31 PM, Mike Dewhirst wrote: On 4/04/2016 12:58 AM, Larry Martell wrote: I import models in the top level of each app

Re: Migrating older 1.4 project to 1.9

2016-04-03 Thread Mike Dewhirst
top of each models module - in other words in ... /models/__init__.py ... which appears to satisfy the Django loading sequence mentioned in the docs to which you refer in the link below. Sorry for misleading. Mike In my app's top level there is an __init__,py that imports modules that imp

Re: Migrating older 1.4 project to 1.9

2016-04-02 Thread Mike Dewhirst
p-level" what do you mean? I import models in the top level of each app so I can say "from app import this, that, other" and it works fine. Django 1.8. Mike and now everything fails with "Apps aren't loaded yet". Getting past that will require a major rewrite of

Re: Model share question

2016-03-30 Thread Mike Dewhirst
On 31/03/2016 8:38 AM, moon jo wrote: I'm new to django and have a question regarding model design. For practice, I'm working on a web app - a simplified version of imdb that handles movie and music. I've created 2 apps; Movies and Music. With main models in both having the usual fields (title, r

Re: Simple subprocess help

2016-03-25 Thread Mike Dewhirst
On 26/03/2016 1:05 AM, Joshua Valdez wrote: I'm very new to django Sorry I didn't pay attention to this part of your question ... To amplfy my response, this is the sort of thing I would do in the save method of the model: from wherever import run_pipeline class Query(models.Model): ..

Re: Simple subprocess help

2016-03-25 Thread Mike Dewhirst
really doing, I would be looking to write a Python equivalent of run_pipeline so that the model instance can do the conversion as part of its save() process - completely invisible from the form. It feels overly complex to trigger an external event then incorporate the result in a differ

Re: Django models choices

2016-03-21 Thread Mike Dewhirst
nter good data. eg., if self.foo not in CHOICES: raise ValidationError("bad foo") Unless there are special reasons otherwise, I think it is much better in the model than the form. Mike -- You received this message because you are subscribed to the Google Groups "Django user

Re: partial database restoration

2016-03-09 Thread Mike Dewhirst
a fixture, maybe with a custom management command, and that still suffers from the need to re-write at schema changes. If you were going to do it, which approach would you take? Thanks Bill M On Wed, Mar 9, 2016 at 6:24 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: I

partial database restoration

2016-03-09 Thread Mike Dewhirst
. I presume this is a Postgres scripting task or is there a Django recipe? Thanks for any pointers Mike -- 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

Re: Absolute beginner question -- recipes

2016-03-06 Thread Mike Dewhirst
On 7/03/2016 2:17 AM, Mike Dewhirst wrote: On Thursday, March 3, 2016 at 3:22:04 AM UTC+11, Simon Gunacker wrote: Inspired by Mike Dewhirsts suggestion on building hierachical structures, Not sure we are on the same page regarding "hierarchical". In the early days hi

Re: Absolute beginner question -- recipes

2016-03-06 Thread Mike Dewhirst
On Thursday, March 3, 2016 at 3:22:04 AM UTC+11, Simon Gunacker wrote: > > Inspired by Mike Dewhirsts suggestion on building hierachical structures, > Not sure we are on the same page regarding "hierarchical". In the early days hierarchical databases only had 1:n relationshi

Re: Trouble Transitioning from SQLite to Postgres

2016-03-04 Thread Mike Dewhirst
elay login so it becomes expensive for brute force attacks. Can you test what the delay is? Maybe Selenium isn't coping with that? Don't know what the SQLite vs Postgres difference might be except SQLite is possibly a bit faster. Mike 1) The login credentials are correct. This

Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
I found the problem. When the mysite\urls.py file is created, it has this line already in it. from django.conf.urls import url The tutorial asks you to add the following lines to the file. from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^pol

Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
I added polls to settings.py : INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polls.apps.PollsConfig', ] Then I tried the migration: C:

Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
Jorr, No, I did not modify the settings.py file, because the tutorial specifically states: Note Ignore the warning about unapplied database migrations for now; we’ll deal with the database shortly. Here is a link to the tutorial: https://docs.djangoproject.com/en/1.9/intro/tutorial01/

Re: Absolute beginner question -- recipes

2016-02-29 Thread Mike Dewhirst
gnore shortcuts aimed at performance initially and make your design perfectly represent the real world. Only when it displays performance problems not fixable with caching should you try and introduce corner cutting in your design. Mike -- You received this message because you are subscribed t

Re: Absolute beginner question -- recipes

2016-02-28 Thread Mike Dewhirst
Key('Substance', null=True, blank=True, related_name='base_substance') ingredient = models.ForeignKey('Substance', null=True, blank=True,) proportion = models.DecimalField(null=True, blank=True) ... Hope this helps Mike -- You received this mes

Re: Error running Django tutorial

2016-02-28 Thread Mike Kipling
Igor, Yes, the server was started. Here are the contents of the command window including after trying to go to the website. C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver Performing system checks... System check identified no issues (0 silenced). You have unapplied migrations

Re: Error running Django tutorial

2016-02-28 Thread Mike Kipling
Found: /polls/ [28/Feb/2016 21:06:30] "GET /polls/ HTTP/1.1" 404 1921 Not Found: /favicon.ico [28/Feb/2016 21:06:31] "GET /favicon.ico HTTP/1.1" 404 1936 On Saturday, February 27, 2016 at 1:50:39 PM UTC-6, Mike Kipling wrote: > > I am working through the Django tutorial *

Re: Error running Django tutorial

2016-02-28 Thread Mike Kipling
= [ url(r'^polls/', include('polls.urls')), url(r'^admin/', admin.site.urls), ] Mike On Saturday, February 27, 2016 at 1:50:39 PM UTC-6, Mike Kipling wrote: > > I am working through the Django tutorial *Writing your first Django app, > part 1.* > I am

Re: Error running Django tutorial

2016-02-28 Thread Mike Kipling
On Saturday, February 27, 2016 at 2:06:42 PM UTC-6, James Schneider wrote: > > > On Feb 27, 2016 11:49 AM, "Mike Kipling" > > wrote: > > > > I am working through the Django tutorial Writing your first Django app, > part 1. > > I am using Windows 10

Error running Django tutorial

2016-02-27 Thread Mike Kipling
I am working through the Django tutorial *Writing your first Django app, part 1.* I am using Windows 10, python 3.5.1 and Django 1.9.2 . In the *Write your first view* section: after writing the polls/views.py and polls/urls.py files, and modifying the manage/urls.py file, and st

Re: bootstrap django crispy forms

2016-02-26 Thread Mike Dewhirst
This is probably wrong for your case but occasionally I have had success overriding (or is that cascading?) style sheets by adding "!important" to the pertinent item in my .css file. On 27/02/2016 2:39 AM, clarksonchri...@gmail.com wrote: A simple upload button is proving difficult to implemen

Re: key specification without a key length

2016-02-22 Thread Mike Dewhirst
On 23/02/2016 6:37 AM, Sammi Singh wrote: Thanks Mike, I'm using models and I made the changes like you suggested but I'm still getting the same error *id = models.CharField(max_length=99, primary_key=True)* That was a stab in the dark trying to indicate to you that a text

Re: key specification without a key length

2016-02-19 Thread Mike Dewhirst
On 20/02/2016 6:26 AM, Sammi Singh wrote: Hi, I'm new to Django and facing this error "*/django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'id' used in key specification without a key length")/*" Here is my code: class Steps(models.Model): Â Â author = models.ForeignKey(User) #Â

Re: Trying to upgrade Django using pip on CentOS results in segmentation fault

2016-02-17 Thread Mike Dewhirst
Try stopping Apache during the upgrade. I need to do that on Ubuntu. Good luck Connected by Motorola Tanuka Dutta wrote: > > > > >down votefavorite > >Hello, > >I have a Linux CentOS 6.7 installation on a VM. A few months ago, I had - >compiled and installed Python 2.7.8 on it - installed vi

Re: Trying to upgrade Django using pip on CentOS results in segmentation fault

2016-02-17 Thread Mike Dewhirst
Try sto Connected by Motorola Tanuka Dutta wrote: > > > > >down votefavorite > >Hello, > >I have a Linux CentOS 6.7 installation on a VM. A few months ago, I had - >compiled and installed Python 2.7.8 on it - installed virtualenv-13.1.2 in >/usr/lib/python2.7/site-packages - installed Django

Re: Running a Django site on a standalone Windows laptop

2016-02-16 Thread Mike Dewhirst
I agree with James. Apache and mod_wsgi is fine on Windows. There may be some Windows-specific Apache conf tweaks but running single-user on a laptop should be easy. On 17/02/2016 6:55 AM, James Schneider wrote: On Tue, Feb 16, 2016 at 6:36 AM, Remco Gerlich mailto:re...@gerlich.nl>> wrote:

Re: [Recipe] Rename a model and its table

2016-02-15 Thread Mike Dewhirst
gh it doesn't seem to affect anything. Cheers Mike On 16/02/2016 1:27 PM, Mike Dewhirst wrote: Hold on. I'm now having trouble with fixtures so please don't follow the recipe until I work it out. So far it seems only the table name has changed to Newname and it still uses all the O

[Recipe] Rename a model and its table

2016-02-15 Thread Mike Dewhirst
migrations.RenameModel('Oldname', 'Newname') migrations.AlterModelTable('Newname', 'appname_newname'), ] 6. migrate Note, you will probably need to or perhaps should delete stale content types at the end of the migration. 7. Run all unit test

Re: How to install on windows?

2016-02-14 Thread Mike Dewhirst
1. Uninstall all versions of Python on your machine 2. Start again and install Python 3.5 (pip was first part of the Python install with 3.4) 3. Continue with https://docs.djangoproject.com/en/1.9/howto/windows/ Good luck and welcome! On 15/02/2016 11:48 AM, bob gailer wrote: I tried follow

Re: [melbourne-pug] OS license requirements

2016-01-12 Thread Mike Dewhirst
Further to this, for the SharedSDS project licensing is now settled on GNU GPL v3 for the bulk of the software. API code will be GNU LGPL v3 Mike On Tuesday, August 12, 2014 at 10:43:58 AM UTC+10, Mike Dewhirst wrote: > > Cross posting again to thank everyone for responding ... > &g

Re: Having trouble understanding Timezone

2016-01-06 Thread Mike Dewhirst
tz.utc) if days == 0: return dday ttime = datetime.time(dday) return timezone.make_aware(datetime.combine( datetime.fromordinal(dday.toordinal() + days), ttime), pytz.utc) HTH Mike On 7/01/2016 2:36 PM, Ryan Causey wrote: Hello, I'm new to Python and Django so please

Re: basic Django 10,000 foot view of users (associating Django User with model class)

2015-12-25 Thread Mike Dewhirst
.user In your extended user model you just need a foreign key to Organization. That user will then only be able to connect to a single organization. Lots of other users will however be able to connect to the same organization. Mike ERRORS: : (admin.E202) 'certapp.Organizatio

Re: Running unittests on different databases

2015-12-25 Thread Mike Dewhirst
o this lets you name any settings file - provided that it imports the settings you don't wish to rewrite - and in which you can rewrite any settings or even add other settings or other code which suits your needs. To continue the recipe I have a settings/production.py which imports &qu

Re: Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-21 Thread Mike Dewhirst
On 22/12/2015 4:22 AM, Tim Graham wrote: Hi Mike, see if the documentation at the bottom of https://docs.djangoproject.com/en/stable/topics/forms/formsets/#django.forms.formsets.BaseFormSet.can_delete helps. Yes it does. Thank you Tim. "If you call formset.save(commit=False), objects wil

Re: Admin debugging delete

2015-12-20 Thread Mike Dewhirst
On 21/12/2015 6:03 PM, James Schneider wrote: I haven't tested this, but I think that will end up looking for False (the 'not' applying to 'instance' rather than the 'in' operation) in self.deleted_objects, which means saving would be broken entirely. It cer

Re: Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-20 Thread Mike Dewhirst
e AND appear in the deleted list. This was precisely what happened in my project and which I was trying to debug. The symptom in the Admin was a checked box for deleting a child record which stubbornly stayed there despite the Admin reporting a successful save. Mike -James -- You receiv

Question re django.forms.models.BaseModelFormSet.save_existing_objects()

2015-12-20 Thread Mike Dewhirst
) 764return saved_instances Line 758 will fail and the object will not be deleted if commit == False but line 757 has already added the object to a list. Is this intended? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users&

Re: Admin debugging delete

2015-12-20 Thread Mike Dewhirst
On 20/12/2015 4:30 PM, James Schneider wrote: > Â Â for instance in instances: > Â Â Â Â if not instance in self.deleted_objects: > Â Â Â Â Â Â instance.modified_by = request.user > Â Â Â Â Â Â instance.save() > > ... but that didn't do anything. Shouldn't that be: if i

Re: Admin debugging delete

2015-12-19 Thread Mike Dewhirst
nstance in self.deleted_objects: instance.modified_by = request.user instance.save() ... but that didn't do anything. Might have to skip adding request.user to modified objects. Thanks again for any advice Cheers Mike Haven't found it yet but I have a question abou

Re: Admin debugging delete

2015-12-18 Thread Mike Dewhirst
Thanks Andreas - I'll dig deeper! Cheers Mike On 18/12/2015 9:02 PM, Andreas Kuhne wrote: Hi, Are you working in django admin and using the delete checkbox to delete a child record? If so, it is not a javascript event, but it is handled by when you save to the parents form (it's

Re: Admin debugging delete

2015-12-18 Thread Mike Dewhirst
Cheers Mike On 17/12/2015 6:41 PM, Mike Dewhirst wrote: I'm having trouble debugging a failed child record Delete. That is the Delete [x] checkbox being ticked does not delete the child record. It is obviously something to do with my bad but I'm not sure where to start. Any hints? Th

Admin debugging delete

2015-12-16 Thread Mike Dewhirst
I'm having trouble debugging a failed child record Delete. That is the Delete [x] checkbox being ticked does not delete the child record. It is obviously something to do with my bad but I'm not sure where to start. Any hints? Thanks Mike -- You received this message becau

Re: Django models in file sharing system

2015-12-10 Thread Mike Dewhirst
On 11/12/2015 5:00 AM, Vasu Dev Garg wrote: models.py : Â `class Document(models.Model): Â Â Â docfile = models.FileField(upload_to='documents/%Y/%m/%d') Â Â Â user = models.ForeignKey(User, null=False, blank= False) ` I have created a model for file upload as shown above. docfile is the f

Re: Drop and replace SQL Table automatically when Model is migrated

2015-12-06 Thread Mike Dewhirst
On 7/12/2015 7:21 AM, Alexander Whatley wrote: This question may just be due to my inexperience with Django, but whenever I modify one of my Model elements and change its parameters, I have to close my IDE and manually use the command prompt to drop the SQL Table corresponding to the Model, and t

Re: [ANNOUNCE] Django 1.9 released

2015-12-02 Thread Mike
> > pip install django > Downloading/unpacking django > Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded > Installing collected packages: django > Compiling > /Users/mike/sieve2/SIEVEENV/build/django/django/conf/app_template/apps.py > ... >

[Not solved] formfield_for_foreignkey difficulty

2015-11-26 Thread Mike Dewhirst
On 27/11/2015 8:38 AM, Mike Dewhirst wrote: On 27/11/2015 8:19 AM, Mike Dewhirst wrote: On 26/11/2015 11:24 PM, Mike Dewhirst wrote: I have formfield_for_foreignkey working for a couple of fields in my substance model but find a brick wall when I try to restrict choices in an inline m2m

[Solved] formfield_for_foreignkey difficulty

2015-11-26 Thread Mike Dewhirst
On 27/11/2015 8:19 AM, Mike Dewhirst wrote: On 26/11/2015 11:24 PM, Mike Dewhirst wrote: I have formfield_for_foreignkey working for a couple of fields in my substance model but find a brick wall when I try to restrict choices in an inline m2m foreign key. It was late last night and I forgot

Re: formfield_for_foreignkey difficulty

2015-11-26 Thread Mike Dewhirst
On 26/11/2015 11:24 PM, Mike Dewhirst wrote: I have formfield_for_foreignkey working for a couple of fields in my substance model but find a brick wall when I try to restrict choices in an inline m2m foreign key. It was late last night and I forgot to mention Django 1.8.7 Admin, Python 3.4

formfield_for_foreignkey difficulty

2015-11-26 Thread Mike Dewhirst
models.DecimalField(null=True, blank=True,) Is that a limitation in the admin or should I try harder? Thanks Mike -- 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: Making a field readonly according to the user in admin.py

2015-11-18 Thread Mike Dewhirst
/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_queryset [2] https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields [3] https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_readonly_fields Mike On

Re: [Django 1.8.6] How to dump sql from models

2015-11-16 Thread Mike Dewhirst
witch off migrations. Mike -- 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+unsubscr...@googlegroups.com. To post to this group, send email

<    4   5   6   7   8   9   10   11   12   13   >