Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:06 AM, Ezequiel wrote: On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: A perhaps better solution would be to disable the Save and Delete widgets/actions in particular circumstances. How can I do something like this? The quick&dirty way I

Re: sidebar menu appears with every click on the main menu item before it disappears

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:13 AM, Behee Trimble wrote: Any body out there to give me a clue about my problem? Please? On Saturday, March 28, 2015 at 7:08:23 PM UTC-4, Behee Trimble wrote: Please help me to detect this problem: sidebar menu appears with every click on the main menu item. I in

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: On 29/03/2015 7:28 PM, Julo wrote: Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: snip That said, maybe I'm not getting your workflow correctly, but to me it seems that if request.user is not owner, some fields shou

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
I am moved to say thank you to all the devs from day 1 for Django. It is a marvellous piece of work. All of it. Thanks Mike On 30/03/2015 6:53 PM, Mike Dewhirst wrote: On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04

Re: login error: hostname doesn't match .... but it does!!!

2015-03-31 Thread Mike Dewhirst
On 1/04/2015 8:06 AM, bwv549 wrote: Just trying to login a new user, but I'm getting this error, which makes no sense to me because it looks like it should match: Login error (https://www.jtprince.dev.doba.com/new-login.html) -- Exception: hostname 'www.jtprince.dev.doba.com' doesn't match eithe

Re: Saving Contionus Data through Django

2015-04-02 Thread Mike Dewhirst
On 3/04/2015 12:14 AM, nitinagarwal...@gmail.com wrote: Hello All I am new to Django. And, I need help in models file. I made a table - device_list. It contain one filed as device_id. Now, I need to store 3 continuous data stream which is coming like 1 entry per minute each for this device_id. A

Re: Using Unicode in django

2015-04-02 Thread Mike Dewhirst
On 3/04/2015 12:01 AM, temiloluwa adesina wrote: Hello I just joined this group and i have problems with representing multiple fields in admin using __unicode__, when i try to call this data it returns just one of them: | classCrop(models.Model): name =models.CharField(max_length=30) i

KeyError: 'default'

2015-04-06 Thread Mike Dewhirst
Can someone please explain what KeyError: 'default' means? This is the first time I have tried Django 1.7 and without doing any migrations all I have done here is this ... (xxex3) C:\Users\mike\env\xxex3\ssds>copy substance\fixtures\test_data.json substance\fixtures\initial_data.json (xxex3

Re: KeyError: 'default'

2015-04-06 Thread Mike Dewhirst
the email, the caret is positioned like this ... FROM "django_co... ^ The dev server runs and the software (unmigrated) works. I just cannot get my unit tests to run under 1.7. It is like the nightmare of finding yourself naked in Times Square! Mike Best regards, Pavel поÐ

Re: KeyError: 'default'

2015-04-07 Thread Mike Dewhirst
Yes I do that. SQLite in dev and Postgres for staging. Hope it helps. Regards, - Flavia @flaviamissi On Mon, Apr 6, 2015 at 11:06 PM Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: On 7/04/2015 1:07 AM, Pavel Kuchin wrote: > Hi Mike, > > I think the is

Re: Question on Extending the existing User model documentation

2015-04-11 Thread Mike Dewhirst
On 10/04/2015 11:06 PM, Larry Martell wrote: Reading this: https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#extending-the-existing-user-model I see this: These profile models are not special in any way - they are just Django models that happen to have a one-to-one link with a Use

Re: Diplay database column headers on HTML programmatically

2015-04-11 Thread Mike Dewhirst
On 12/04/2015 3:38 PM, Kishan Mehta wrote: Hey Friends, There is a model.py and i want to add its column headers in drop down list in HTML. Any way to pass them through views.py ? Dont want to hardcode at HTML because too many columns . You probably want https://docs.djangoproject.com/en/1.8/

Re: Trying understand static files.

2015-04-22 Thread Mike Dewhirst
On 23/04/2015 9:35 AM, john wrote: Hi, I have created a website that works well under "runserver". But when I use nginx and uwsgi the basic website comes up but it is missing the static file information. I have run "manage.py collectstatic" but still no static files are used. Reading the Django

Re: django 1.8.1 : A server error occurred. Please contact the administrator.

2015-04-24 Thread Mike Dewhirst
On 25/04/2015 3:13 AM, JMKoushyar wrote: Ho guys, I'm new to django framework. According to Instructions in the djangoproject.com I did all the things and everything was pretty good but when I tried to open my django project in browser by "python manage.py runserver", I got some errors. The page

Re: Migrations During Development

2015-04-25 Thread Mike Dewhirst
On 25/04/2015 10:26 PM, Timothy W. Cook wrote: Django 1.8 Â Python 3.4 PostgreSQL 9.3 During development I am creating several migrations. It seems unnecessary to keep these since they only exist on my dev machine. Â Any data that I have created can be thrown away too. Is it safe to delete thes

Re: Turn off migrations completely in Django 1.7

2015-04-27 Thread Mike Dewhirst
On 27/04/2015 9:54 AM, marcin.j.no...@gmail.com wrote: So what about that? I'm also interested in disabling migrations. I need to upgrade Django in big project (from 1.4 to newer version) because of lack of support for 1.4, but migrations included in v1.7 will complicate this process. Would it

Re: Turn off migrations completely in Django 1.7

2015-04-27 Thread Mike Dewhirst
: On Apr 27, 2015, at 7:01 PM, Mike Dewhirst wrote: On 27/04/2015 9:54 AM, marcin.j.no...@gmail.com wrote: So what about that? I'm also interested in disabling migrations. Would it suffice to have all your models specify "managed = False" in the Meta class? https://docs.djangop

Re: Deploying django

2015-05-03 Thread Mike Dewhirst
On 4/05/2015 6:08 AM, João Marques wrote: Now what happens when I run the server in "debug = False" is an error 500. Without the "debug = False" I get this:'Empty static prefix not permitted'. Googling that error brings up a few results. It seems to indicate a problem with STATIC_ROOT and STAT

Re: How to represent a calendar month as a field in django models

2015-05-03 Thread Mike Dewhirst
On 4/05/2015 11:41 AM, Tom Lockhart wrote: On May 3, 2015, at 2:35 PM, Matthys wrote: I posted the question also on stackoverflow: http://stackoverflow.com/questions/30017229/how-to-represent-month-as-field-on-django-model The question is for situations where a model instance relates to a sp

Re: How to represent a calendar month as a field in django models

2015-05-03 Thread Mike Dewhirst
On 4/05/2015 12:31 PM, Tom Lockhart wrote: Surely that would destroy data which wouldn’t be desirable. I’m not sure how that follows. If you are adjusting a date from whatever it actually is to the first of the month you lose the actual date. Although the question does not state it exp

Re: Deploying django

2015-05-04 Thread Mike Dewhirst
”œâ”€â”€ tests.py └── views.py On Monday, 4 May 2015 00:16:00 UTC+1, Mike Dewhirst wrote: On 4/05/2015 6:08 AM, João Marques wrote: > Now what happens when I run the server in "debug = False" is an error > 500. Without the "debug = False&qu

percentage or number data entry solution please

2015-05-10 Thread Mike Dewhirst
In the Admin I want the user to be able to enter a decimal number with a percentage sign (eg 33.3%) or without (eg 33.3) and to collect it as a decimal number. At the moment DecimalField barfs if the user enters a human style percentage sign. My initial thought is to change it to a CharField

Re: percentage or number data entry solution please

2015-05-11 Thread Mike Dewhirst
n enhancement along the lines of a DecimalField arg/kwarg which lets the form accept a % sign but throws it away. I have added some help text which explains what to do. Thanks Derek Mike On Monday, 11 May 2015 02:45:00 UTC+2, Mike Dewhirst wrote: In the Admin I want the user to be abl

Re: committing after fixture load or running tests without transactions

2015-05-12 Thread Mike Dewhirst
On 13/05/2015 5:07 AM, Larry Martell wrote: I have a situation where I need to run an external python script in a test after the tables are loaded from fixtures. This doesn't work because django runs the tests in a transaction and the external python script is running in its own MySQL connection

Re: icontains case-sensitive on MySQL

2015-05-31 Thread Mike Dewhirst
On 1/06/2015 5:57 AM, Jake Gordon wrote: There needs to at least be a warning in the documentation. https://docs.djangoproject.com/en/1.8/ref/databases/#collation-settings I spent a lot of time debugging only to find this was a problem with Django. On Thursday, October 16, 2008 at 6:56:07 P

Re: need to upgrade django1.4.5-->django1.5, but apt-get install django tells me i'm running latest version

2015-06-01 Thread Mike Dewhirst
On 2/06/2015 3:17 AM, arthur sherman wrote: i get the following errors in the apache2 error.log: VersionConflict: (Django 1.4.5 (/usr/lib/python2.7/dist-packages), Requirement.parse('Django>=1.5')) but when i attempt upgradinging django apt-get install reports that i'm at the latest version:

Re: Where to now??

2015-06-01 Thread Mike Dewhirst
On 2/06/2015 4:28 AM, Steve Burrus wrote: *Well I successfully instsalled Dj and ango 1.8*. After doing the "pip freeze" command in my Win 10 beta command prompt I see that I g ot that version of Django installed. But where do I go from here? How do i launch the server It is probably best to fo

Re: Trouble w. Setting Up Virtual Env.

2015-06-02 Thread Mike Dewhirst
Steve If you have uninstalled and reinstalled virtualenv exactly the way the virtualenv docs require for Windows and you still get the same problem I think your environment must be blocking things. Maybe there is a virtualenv mailing list you could join and get some help from virtualenv expe

Re: how to get get-pip.py

2015-06-03 Thread Mike Dewhirst
On 4/06/2015 8:42 AM, Steve Burrus wrote: well I am still waiting for an answer to my earlier post about pip and apparently not configuring it right. Have you looked at the pip website? Maybe there is a user support mailing list for pip. But in any case, perhaps you should use Python >= 3.4

Re: how to get get-pip.py

2015-06-03 Thread Mike Dewhirst
                                              Steve B. * * * *On Wed, Jun 3, 2015 at 8:04 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: * *On 4/06/2015 8:42 AM, Steve Burrus wrote: *

heavy refactoring

2015-06-09 Thread Mike Dewhirst
With Django 1.7 and Postgres I want to change the name of an app. From my initial investigation it looks like I need to create a new app with the desired name and then blow the old one away after pumping the data across. Then comes the refactoring. At the moment I just use a vanilla text edi

Re: heavy refactoring

2015-06-09 Thread Mike Dewhirst
On 9/06/2015 6:43 PM, Erik Cederstrand wrote: Den 09/06/2015 kl. 10.09 skrev Mike Dewhirst : Does anyone have any experience with app-renames and maybe some refactoring advice for me? Maybe I don't even need to replace and destroy ... If you wanted, you could set Meta.db_table fo

Re: Simulating REMOTE_USER login with the test server

2015-06-09 Thread Mike Dewhirst
On 10/06/2015 7:07 AM, Gergely Polonkai wrote: Hello, I’m about to use the test server with REMOTE_USER based logins. I already know how to set it up with my Apache based server, but I can see no way of doing the same with the dev server (manage.py runserver). I have tried setting the environm

Re: heavy refactoring

2015-06-11 Thread Mike Dewhirst
roaching. What are your thoughts? Mike a. On Tuesday, 9 June 2015 09:09:56 UTC+1, Mike Dewhirst wrote: With Django 1.7 and Postgres I want to change the name of an app. From my initial investigation it looks like I need to create a new app with the desired name and t

Re: Ready to throw the keyboard using Django 1.7 on Windows 7

2015-06-19 Thread Mike Dewhirst
On 20/06/2015 2:16 AM, Todd Kovalsky wrote: Having a miserable time trying to get a django site running on a wintel box. The issue comes after I add models to models.py. I keep getting the error Could not import settings 'myapp.settings'...No module named myapp.settings. Your DJANGO_SETTINGS_

Re: Inconsistency when importing views and models

2015-06-19 Thread Mike Dewhirst
On 20/06/2015 11:01 AM, jorrit...@gmail.com wrote: This is mostly a cosmetic question, and I could be completely wrong because I'm fairly new to Django, or it could be that there is a perfectly logical explanation for this, but here goes: It seems the code required to import views in urls.py and

ModelAdmin.save_as integrity error

2015-06-22 Thread Mike Dewhirst
The following is all I could find in the docs about ModelAdmin.save_as ModelAdmin.save_as (https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_as) Set save_as to enable a “save as” feature on admin change forms. Normally, objects have three sa

[Partly solved] ModelAdmin.save_as integrity error

2015-06-22 Thread Mike Dewhirst
:57 PM, Mike Dewhirst wrote: The following is all I could find in the docs about ModelAdmin.save_as ModelAdmin.save_as (https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_as) Set save_as to enable a “save as†feature on admin change forms

Re: ModelAdmin.save_as integrity error

2015-06-23 Thread Mike Dewhirst
io de 2015, Mike Dewhirst mailto:mi...@dewhirst.com.au>> escribió: > I commented out the save() method in the Substance model (the master model with a number of 1:1 and 1:n relationships) and it started saving as new successfully. Unfortunately I do a lot of stuff in that save() metho

Atomic block termination question

2015-06-23 Thread Mike Dewhirst
When saving a model I'm getting a TransactionManagementError - You can't execute queries until the end of the 'atomic' block Ticket #21540 seems fairly explicit at least where Postgres is concerned. TransactionManagementError prevents what I want to do and I'm not a nuclear expert. How do I

Re: Atomic block termination question

2015-06-24 Thread Mike Dewhirst
On 24/06/2015 4:43 PM, Mike Dewhirst wrote: When saving a model I'm getting a TransactionManagementError - You can't execute queries until the end of the 'atomic' block Ticket #21540 seems fairly explicit at least where Postgres is concerned. TransactionManagementError pre

Re: Atomic block termination question

2015-06-25 Thread Mike Dewhirst
Carl On 25/06/2015 2:34 AM, Carl Meyer wrote: Hi Mike, On 06/24/2015 02:16 AM, Mike Dewhirst wrote: On 24/06/2015 4:43 PM, Mike Dewhirst wrote: When saving a model I'm getting a TransactionManagementError - You can't execute queries until the end of the 'atomic' block

Re: Atomic block termination question

2015-06-25 Thread Mike Dewhirst
Carl Thank you very much. Great overview. Confidence boosting. Mike On 26/06/2015 2:57 AM, Carl Meyer wrote: Hi Mike, On 06/25/2015 01:53 AM, Mike Dewhirst wrote: On 25/06/2015 2:34 AM, Carl Meyer wrote: On 06/24/2015 02:16 AM, Mike Dewhirst wrote: On 24/06/2015 4:43 PM, Mike Dewhirst

Re: new installations tryout problem

2015-06-26 Thread Mike Dewhirst
On 26/06/2015 3:24 PM, Elim Qiu wrote: Installed django recently, followed the django tutorial pdf to some where arround page 20. But got problems... It's on ubuntu 14.04, I have ipython installed and the following command some how brings up ipython. And it will raise exception for command Quest

Re: How To Activate Django Server.

2015-06-27 Thread Mike Dewhirst
On 27/06/2015 11:43 AM, Steve Burrus wrote: we;ll here is the error message that I get when I try to install django in the virtual env. : "C:\Users\SteveB\Desktop\myenv>.\Scripts\activate (myenv) C:\Users\SteveB\Desktop\myenv>pip install django Fatal error in launcher: Job information querying fa

Re: settings.configure() does not allow me to access custom variables in settings.py

2014-07-04 Thread Mike Dewhirst
On 5/07/2014 7:12 AM, Chen Xu wrote: Hi Everyone, I want to access some variables in my settings.py without starting my server, I know I will have to run settings.configure(); however, running settings.configure() does not allow me to access my custom variables. What should I do with that. Per

Re: How to install Django on Windows - pip, command prompt.

2014-07-05 Thread Mike Dewhirst
http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows On 6/07/2014 1:24 PM, Sen wrote: I was going through https://docs.djangoproject.com/en/1.6/howto/windows/#how-to-install-django-on-windows I could follow until "In the command prompt, execute the following command: pip in

Re: Django newbie issues

2014-07-06 Thread Mike Dewhirst
Janelle Your quickest solution is to reveal your location and ask for someone to help out on a short-term basis. There are heaps of Django people everywhere and many inhabit this list. What you are asking for is possibly quite easy but can defeat you if you are unfamiliar with the environmen

Re: Django newbie issues

2014-07-07 Thread Mike Dewhirst
On 8/07/2014 2:22 AM, Janelle O'Dea wrote: Thank you, Mike. I haven't tried your first option yet, but I will either today or tomorrow. What kinds of clues would I look for in settings? Django needs credentials to access the database and there should be a mechanism specified in settings to get

Re: Django newbie issues

2014-07-08 Thread Mike Dewhirst
settings.py, I > probably don't have them...am I screwed?) how can I get to and dump the db? > > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote: >> >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote: >> > Thank you,

Re: RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)

2014-07-10 Thread Mike Dewhirst
On 11/07/2014 1:44 PM, Neto wrote: Hi guys, I need a help here: *settings.py* TIME_ZONE = 'America/Sao_Paulo' *view.py:* task = Task.objects.get(id=id) task.start = request.GET['task_start'] tarefa.save() Terminal: RuntimeWarning: DateTimeField Task.start re

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Mike Dewhirst
On 14/07/2014 4:48 AM, Aeh. ABID wrote: I Have a model AB that holds two foreign keys A_id and B_id. |class AB(models.Model): A_id= models.ForeignKey('A') B_id= models.ForeignKey('B') field_1= models.CharField(max_length=200, blank=True) field_2= models.CharFi

Re: Django-admin set foreign key to Null for inlines selected item instead of delete

2014-07-13 Thread Mike Dewhirst
On 14/07/2014 9:23 AM, Aeh. ABID wrote: i'm bit confused here, shouldn't ovverride delete() instead of save() ? and how to retrieve selected items ? Not really. You don't want to delete anything. You want to break a link. Making the foreign key field null will do that. It sounds like you mig

Re: Recommendation/alternative for multi-tenancy under django

2014-07-18 Thread Mike Dewhirst
On 19/07/2014 3:51 AM, Subodh Nijsure wrote: This is the first time I am trying to implement multi-tenant setup under django and hence the question. Problem/Setup - There are two companies signed up for service from portal I am developing say CompanyA, CompanyB. - Each user with this setup is

Re: How do I make my form process data and output in another page?

2014-07-21 Thread Mike Dewhirst
On 22/07/2014 1:07 PM, Jordan S wrote: Hi, I'm trying to make a molecular mass calculator webpage, where a user inputs a chemical formula and gets the mass as a result. I've made this work in python using raw_input(), but now I'd need to use a form with django. I have the html form set up, but w

Re: How to call a function when a project starts.

2014-07-30 Thread Mike Dewhirst
On 31/07/2014 5:57 AM, Chen Xu wrote: Hi Everyone: I would like to call a function when my project starts, basically I want to call a do_something() when I run python manage.py runserver. However, when I put it into settings.py, it gets called twice, but I only want it to execute once. Is there

Re: How do I get Django to ignore javascript code because its throwing an exception

2014-07-31 Thread Mike Dewhirst
On 1/08/2014 3:37 AM, G Z wrote: doesn't work because then my charts dont appear when i enclose the script tag. Can you put the js into a file and use the template to include it? On Wednesday, July 30, 2014 7:44:48 PM UTC-6, Camilo Torres wrote: Hello, you can use 'verbatim': https:

GHS classification interest

2014-08-10 Thread Mike Dewhirst
Is anyone here interested in the GHS? Or working for a large chemical manufacturer? I'm building a GHS classification system which constructs jurisdictionally aware SDSs. It is reaching the point where I need to bring others into it. Thanks Mike -- You received this message because you are

OS license requirements

2014-08-10 Thread Mike Dewhirst
Apologies for cross-posting I'm getting near to open sourcing a Django project and have to choose an appropriate license. Can anyone help me choose? I have settled on the following requirements ... 1. Project source must be freely available for end users to view and download and modify and f

Re: GHS classification interest

2014-08-10 Thread Mike Dewhirst
7;m hoping for a core team of half a dozen but it will depend on industry interest. Mike Thanks. On Mon, Aug 11, 2014 at 5:58 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: Is anyone here interested in the GHS? Or working for a large chemical manufacturer? I&

Re: OS license requirements

2014-08-11 Thread Mike Dewhirst
disclose this communication to others; further, please notify the sender by replying to this message and then delete this message from your system. Thank you. From: django-users@googlegroups.com on behalf of Mike Dewhirst Sent: Sunday, August 10, 2014 8:34

Re: [melbourne-pug] OS license requirements

2014-08-11 Thread Mike Dewhirst
blic-license-mpl-2-0-vs-lesser-gnu-general-public-license-lgpl-3-0 On 11/08/2014 10:34 AM, Mike Dewhirst wrote: Apologies for cross-posting I'm getting near to open sourcing a Django project and have to choose an appropriate license. Can anyone help me choose? I have settled on the fol

Re: Autofill user for a created_by type of field (not in admin)

2014-08-11 Thread Mike Dewhirst
On 12/08/2014 12:40 PM, Craig Jones wrote: I know that this is a common question and I have seen many, many answers when I google about this, but I need some advice. What I have is a field in my models called entered_by which is ForeignKey to the User model. I would like to have this filled auto

Re: How to disable application / project?

2014-08-14 Thread Mike Dewhirst
On 14/08/2014 8:38 PM, Daniel Grace wrote: I have two projects "djangotest" (from the django tutorial) and "cresta". When I start the server with the "runserver" command in the cresta directory and go to http://127.0.0.1:8000/admin/ ... I see "Polls Tutorial". I can't login with any users from t

dba designer consulting needed

2014-08-14 Thread Mike Dewhirst
I'm looking for a DBA designer in Melbourne for some paid consulting. I have a Django 1.6 prototype system working nicely with Postgres 9.1. But it was designed as a proof-of-concept rather than a production system. I figured the project wouldn't actually get off the ground without funding and

Re: dba designer consulting needed

2014-08-15 Thread Mike Dewhirst
nd Regards Robin St.Clair On 15/08/2014 05:19, Mike Dewhirst wrote: I'm looking for a DBA designer in Melbourne for some paid consulting. I have a Django 1.6 prototype system working nicely with Postgres 9.1. But it was designed as a proof-of-concept rather than a production system. I figu

Re: Your further steps after tutorial?

2014-08-21 Thread Mike Dewhirst
On 22/08/2014 9:01 AM, Yarick Antonov wrote: What did you did after you've completed the tutorial ? I mean, you have basic knowledge of how Django works, what was your further steps towards becoming Django expert? That's easy. Build some

Re: Preparing virtualenvwrapper for Django 1.6 development

2014-08-22 Thread Mike Dewhirst
On 23/08/2014 7:23 AM, Sithembewena Lloyd Dube wrote: Hi everyone, I am developing on a Windows 8.1 machine and wold like to setup virtualenvironment via virtualenvwrapper so as to have a properly set up Python development environment. I am referring to Jeff Knupp's guide at http://www.jeffknu

MultiValueDictKeyError in Django 1.6

2014-08-27 Thread Mike Dewhirst
On updating from Django 1.5 to 1.6 I'm seeing MultiValueDictKeyError (see below) on saving a fairly complex set of linked models in the Admin whether anything actually changed or not. Postgres 9.1 Python 2.7 and 3.4 Apache on Ubuntu 12.04 and manage.py runserver on Windows 8.1 Downgrading to 1

Re: MultiValueDictKeyError in Django 1.6

2014-08-27 Thread Mike Dewhirst
On 28/08/2014 10:26 AM, Collin Anderson wrote: are you using a custom template or a custom form? That was it. Thank you very much Collin Cheers Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop r

Re: Change "Add another" text in inline views

2014-08-30 Thread Mike Dewhirst
On 31/08/2014 10:05 AM, stua...@longlandclan.yi.org wrote: Hi all, This is a bit of a silly question, but I wonder if it is possible to change the "Add Another" text that appears on inline forms with related models. I'm in the process of writing a network configuration module in Django that tal

Re: User Created Objects (models)

2014-09-16 Thread Mike Dewhirst
On 16/09/2014 2:02 PM, Pitchblack wrote: Is there a way to add the user to the data model, so it knows who created the record and who updated it last? You need to establish a couple of foreign key fields in your model (eg created and updated) which both link to auth.user. Then grab request.us

Re: User Created Objects (models)

2014-09-16 Thread Mike Dewhirst
at page comes up scroll down a little to see Relationship fields in the right-sidebar. The link you want is Arguments. Alternatively, you could search for related_name but I think you would be better served as a beginner to start at the entry page and to follow your nose from there. Good luck

Re: trouble in startproject

2014-09-25 Thread Mike Dewhirst
On 25/09/2014 9:14 PM, Jorge Andrés Vergara Ebratt wrote: Do you have django installed? pip install django Do you have pip installed? http://pip.readthedocs.org/en/latest/installing.html On Sep 25, 2014 6:08 AM, "nandita srivastava" mailto:nanditas...@gmail.com>> wrote: Hi, I am

Re: Less files not compressed on production

2014-09-25 Thread Mike Dewhirst
On 26/09/2014 12:11 AM, Denis Simonet wrote: The less files are collected to STATIC_ROOT: Did you do that via collectstatic? The following works for me ... /usr/bin/python /var/www/ssds/manage.py collectstatic --settings=ssds.settings.staging --noinput ... in Django 1.6.x on Ubuntu 12.04 an

Re: Django installation issue on Win 7 Pro 64 Bits

2014-09-25 Thread Mike Dewhirst
On 26/09/2014 10:17 AM, Ivo Roupa wrote: Hello, My OS is Win 7 Pro 64 Bits, I have Python 2.7 correctly installed and I'm trying to install Django 1.7 but I'm getting the following error: "c:\Program Files (x86)\Python27\lib\site_packages\win32com\gwn_py\__init__.py: Permission denie

Re: Switching from Linux to Windows for development of Django applications

2014-09-27 Thread Mike Dewhirst
On 28/09/2014 5:18 AM, Avraham Serour wrote: some packages that requires compilation could be a headache, the easier path is to get a binary and use easy_install to install inside the venv Chris Gohlke is your very best friend ... http://www.lfd.uci.edu/~gohlke/pythonlibs/ ... makes Windows

Re: Switching from Linux to Windows for development of Django applications

2014-09-27 Thread Mike Dewhirst
On 28/09/2014 3:09 AM, Some Developer wrote: If anyone can post information on their Windows development work flows I'd be very grateful since I'm pretty new to Windows development work. * This goes against Microsoft recommendations but I install Python2.x and Python3.x in the root of drive

Re: Problems with psycopg2 on Windows 7 64 bit

2014-09-27 Thread Mike Dewhirst
On 28/09/2014 1:47 AM, Daniel Grace wrote: I got around this particular problem. The Windows installer for psycopg (at http://www.stickpeople.com/projects/python/win-psycopg/

Re: Force date and time formats to ISO

2014-10-01 Thread Mike Dewhirst
On 1/10/2014 10:35 PM, Collin Anderson wrote: I wonder if it's possible to somehow use a custom locale that will always show ISO dates. I believe some of the Scandinavian countries use ISO natively ... -- You received this message because you are subscribed to the Google Groups "Django user

Re: Config: DB or git?

2014-10-01 Thread Mike Dewhirst
On 1/10/2014 10:56 PM, Collin Anderson wrote: If you're a programmer or sysadmin, configuration should be done in files. #getcreds.py # -*- coding: utf-8 -*- # this is the only django import permitted in settings files from django.core.exceptions import ImproperlyConfigured def getcreds(fnam

Re: Applying migrations to (non-interactive) production server

2014-10-02 Thread Mike Dewhirst
On 3/10/2014 12:31 AM, Carlos A. Carnero Delgado wrote: Hi, I have succesfully upgraded an application to 1.7, and the time has come to apply a migration. In my development environment this is, as expected, a non issue; however, this particular application is hosted in a server where I'm not all

Re: display text value of a positiveintegerfield

2014-10-08 Thread Mike Dewhirst
On 9/10/2014 1:58 PM, 6233114 6233114 wrote: *How do I display the text value of the saved select list value?* For example if the user has saved 2 as the achievement_type, how do I display *Academic Achievement* and not the number 2. Easy ... https://docs.djangoproject.com/en/dev/ref/models/

save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-14 Thread Mike Dewhirst
Using Django 1.6.7, in the Admin if I change the name of an object (in this case "substance") with 1:1 relationships and click [Save as new] I get an integrity error[1]. This was working in Django 1.5.x. Before I put in the effort to roll back to 1.5 for proof I thought I'd check the docs and

Re: Incremental inspectdb, anyone?

2014-10-15 Thread Mike Dewhirst
On 16/10/2014 7:11 AM, Ken Winter wrote: 4. Inspect a DB schema and modify the Django model set so that they match completely. Much harder, because it involves (a) comparing every detail of each existing model with the DB schema, (b) altering and deleting models as well as just creating them, a

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-16 Thread Mike Dewhirst
+1 Well said Carl. Ken, if you do "stuff" outside Django it means you need to maintain code in more than one place. I was warned against such as a youngster so I have never done it but I suspect it will either drive you mad or cost you dearly. For the external updaters, how will you keep th

Solved: save as new in the Admin with 1:1 inlines causes IntegrityError

2014-10-17 Thread Mike Dewhirst
I discovered a unicode problem related to the degree symbol (°) when running under Python 2.7 and dealt with that. It somehow fixed the IntegrityError. One of those things I guess AWTEW Mike On 15/10/2014 9:40 AM, Mike Dewhirst wrote: Using Django 1.6.7, in the Admin if I change the name

Re: Auto-filling others ImageFields based on the original one

2014-10-31 Thread Mike Dewhirst
On 1/11/2014 2:35 AM, Sasa Trifunovic wrote: Hi, I have to save 3 versions of uploaded photo (and i dont want to use solr) , original one and two which are resized versions of the original one. I need those two additional photos as ImageFields in my model , due to the fact that i want to use dj

Re: Development using django: wireframes enough to begin?

2014-11-04 Thread Mike Dewhirst
On 5/11/2014 3:04 AM, Dave wrote: I'm trying to understand how using django for development works. Can a backend developer begin with just a wireframe? Yes. Start with your models and give them methods and fields you know will be needed. Importantly you should write unit tests to prove your m

Re: How access verbose_name of a instance in template?

2014-11-05 Thread Mike Dewhirst
On 6/11/2014 2:29 PM, Neto wrote: How access verbose_name of a instance in template? I have: car = Car.objects.get(pk=1) Try this in a script somewhere to see if it returns the verbose name def get_verbose_name(obj, field): return obj.__class__()._meta.get_field_by_name('{0}'.format(fie

Re: Issue in Django 1.7.1 with __unicode__ and admin site?

2014-11-11 Thread Mike Dewhirst
On 12/11/2014 7:26 AM, Jorge Andrés Vergara Ebratt wrote: When you are in Python3 you don't use __unicode__ you use __str__ You can leave __unicode__ in place for Python 2.x and add ... def __str__(self): return self.__unicode__() ... to satisfy Python 3.x at the same time On Tue, Nov

Logging \u2083 as cp1252 UnicodeEncodeError in Python 3.4

2014-11-24 Thread Mike Dewhirst
Somehow recently the character causing the logging problem is one of many which are working well in the browser. They are unicode subscripted numbers for example, \u2083 is subscripted "3". But in logging under Python 3.4 it causes --- Logging error --- Traceback (most recent call last): Fil

ModelAdmin.has_change_permission gives 403

2014-11-25 Thread Mike Dewhirst
From the docs ... https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#django.contrib.admin.ModelAdmin.has_change_permission ... is working nicely except it just pops up a standard error page 403 Forbidden when it returns False. How can I intercept this in the Admin and treat it like an e

Re: ModelAdmin.has_change_permission gives 403

2014-11-25 Thread Mike Dewhirst
On 26/11/2014 11:59 AM, Mike Dewhirst wrote: From the docs ... https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#django.contrib.admin.ModelAdmin.has_change_permission ... is working nicely except it just pops up a standard error page 403 Forbidden when it returns False. Actually, I

Re: ModelAdmin.has_change_permission gives 403

2014-11-26 Thread Mike Dewhirst
e model should be read-only based on request.user > # and obj. > return flatten_fieldsets(self.get_fieldsets(request, obj)) > > > Simon > > Le mardi 25 novembre 2014 22:20:33 UTC-5, Mike Dewhirst a écrit : >> >> On 26/11/2014 11:59 AM, Mike Dewhirst wrot

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-02 Thread Mike Dewhirst
On 3/12/2014 1:58 AM, Danish Ali wrote: can someone help please ? I haven't been watching this thread but I just solved a similar problem with 'NoneType is not iterable' My problem was fixed when I ensured the functions involved got passed a type they were expecting. I'm guessing you shou

Re: Django development server crash on syntactic or indent error after check

2014-12-04 Thread Mike Dewhirst
On 4/12/2014 7:58 PM, Mario De Frutos Dieguez wrote: First of all i want to say hi!, i'm new in the group :) I'm having a problem with the development server (a.k.a runserver). When i'm working in a file but i have an error (for example indent error or syntactic error) the server crash instead o

Re: ANN: Django website redesign launched

2014-12-17 Thread Mike Dewhirst
On 17/12/2014 7:59 PM, Cal Leeming wrote: you have to avoid things like "thin" font weights I'm interested to know what fonts are being used so I can install them on my machine. Chrome and Firefox make text on the new site look ragged. Windows 8.1. Other than that, +1 Mike -- You receiv

Re: Accessing Models After get_model()

2014-12-21 Thread Mike Dewhirst
Have you enabled admindocs? Might be the solution you are looking for. Connected by Motorola llanitedave wrote: >I'm trying to display a list of the models in my app on a web page, similar to >the way the Django Admin does it.  I'm not sure where the admin section is >coded, which might be

<    2   3   4   5   6   7   8   9   10   11   >