Re: Strange new error

2011-11-17 Thread Mike Dewhirst
On 18/11/2011 9:48am, Gchorn wrote: Is hard drive corruption like this a common occurrence, and can it be avoided? http://en.wikipedia.org/wiki/Hard-disk_failure http://static.googleusercontent.com/external_content/untrusted_dlcp/labs.google.com/en//papers/disk_failures.pdf ymmv mike -- You

Re: Detect runserver in settings.py?

2011-11-21 Thread Mike Dewhirst
I found this in stackoverflow some time ago. Not sure who to thank but it works for me ... import socket if socket.gethostname() == '': DEBUG = True else: DEBUG = False hth Mike On 22/11/2011 8:03am, Jim wrote: Hello, Inside of my settings.py I'd like to know whether I am running

Re: How-to for static files?

2011-11-22 Thread Mike Dewhirst
On 22/11/2011 9:16pm, Gchorn wrote: Oh yes, I definitely have this in my INSTALLED_APPS list (as simply 'myapp'). Sorry I left it out; I thought this was necessary regardless of whether or not I was using static files, so I didn't include it in the list of settings I changed just to enable stati

Re: django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Mike Dewhirst
There was a great solution to this posted just yesterday ... import sys if 'runserver' in sys.argv: DEBUG = True else: DEBUG = False ... which suggests if 'test' in sys.argv: do this On 24/11/2011 9:53am, Gelonida N wrote: Hi, I just started reading about django testing. Now

Security design questions

2011-11-27 Thread Mike Dewhirst
Can someone please help me with a design dilemma? The scenario is multiple companies each with their own users to edit corporate information. Companies have divisions each with their own assets and associated information. I'm envisaging at least one corporate admin who can adjust anything for

Re: Security design questions

2011-11-28 Thread Mike Dewhirst
Javier Thank you - that looks great. I'll start coding ... Cheers Mike On 29/11/2011 1:24am, Javier Guerra Giraldez wrote: On Mon, Nov 28, 2011 at 2:21 AM, Mike Dewhirst wrote: 1. Do I have to create many-to-many relationships and before serving a page make sure the user making the re

Re: django tests. where to create users

2011-11-28 Thread Mike Dewhirst
On 29/11/2011 12:12pm, Gelonida N wrote: So it seems, I am stuck with fixtures at least at the moment I do not know how to create users without fixtures such, that they would be persistent between unit tests. I agree - you are stuck. Perhaps a two tier approach might work. If you bite the bul

Re: Updating parent record, when child record changes

2011-12-06 Thread Mike Dewhirst
On 6/12/2011 8:40pm, zobbo wrote: I asked a similar question last week but got no responses - here's a related but hopefully simpler question. What is the recommended way to update a field on a parent record when one or more of it's child records (held in inlines) are modified? I could hook on p

Re: Django Upload Image Help

2011-12-12 Thread Mike Dewhirst
On 13/12/2011 5:25am, cmc wrote: write_info = "name: %s\n caption: %s\n source: %s\n more_info: %s\n\n" % photo.name, caption, source, more_info and I've always had to put parentheses around the values on the right hand side of the % like this ... write_info = "name: %s\n caption: %

get_FOO_display

2011-12-12 Thread Mike Dewhirst
I'm getting a puzzling error trying to follow the dev docs here ... https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display I syncdb'd a simple test model to eliminate everything except the essentials with ... class SimpleTest(models.Model): THI

Re: get_FOO_display

2011-12-12 Thread Mike Dewhirst
On 13/12/2011 5:21pm, kenneth gonsalves wrote: On Tue, 2011-12-13 at 17:16 +1100, Mike Dewhirst wrote: THINGS = ( (0, 'Thing Zero'), (1, 'Thing One'), ) what happens when you do: THINGS = ( ('0', 'Thing Zero'), (&#

Re: get_FOO_display

2011-12-13 Thread Mike Dewhirst
anning to have only Integer > values for the choices. > > > -- > eng. Ilian Iliev > Web Software Developer > > Mobile: +359 88 66 08 400 > Website: http://ilian.i-n-i.org > > > On Tue, Dec 13, 2011 at 9:53 AM, Mike Dewhirst wrote: > On 13/12/2011 5:21p

Re: Weekly discussion/randoms thread..

2011-12-23 Thread Mike Dewhirst
Have you considered The Python Papers? It is an edited journal with two streams: Industrial and Academic both of which are peer reviewed - to slightly different degrees of rigour. I'm sure the editors would be happy to add a Django "column" and indeed would welcome Django-gurus as specialist

Re: django/Data Base Advice

2012-01-02 Thread Mike Dewhirst
On 3/01/2012 10:59am, Chris Kavanagh wrote: On Jan 2, 6:57 pm, Chris Kavanagh wrote: I'm new to django& programming in general. I know the basics of Python. Anyways, going through the djangoproject tutorial, I came to the part where you edit the polls/models.py, and this is where I need advi

business integrity rule

2012-01-04 Thread Mike Dewhirst
How should I do this? Obj-1 <---[n:M]---> Obj-2 Obj-1 is in one table and Obj-2 is in a different table. The business rule is that a relationship must exist between two companies before there can be a link between Obj-1 and Obj-2. One company owns Obj-1 and the other company needs access to

Re: business integrity rule

2012-01-04 Thread Mike Dewhirst
Got it sorted now thanks ... Mike On 5/01/2012 2:55pm, Mike Dewhirst wrote: How should I do this? Obj-1 <---[n:M]---> Obj-2 Obj-1 is in one table and Obj-2 is in a different table. The business rule is that a relationship must exist between two companies before there can be a link b

molecular formulae

2012-01-05 Thread Mike Dewhirst
Does anyone know of a Django widget for representing molecula formulae? For example, entering h2o would display with the 2 subscripted and the h and o both uppercased. Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: molecular formulae

2012-01-05 Thread Mike Dewhirst
else: char = char.upper() formula += char return formula """ ... which seems to work even when re-saving. The subscripts seem to be interpreted as numbers too. Thanks Mike On 6/01/2012 3:08pm, Mike Dewhirst wrote: Does anyone know of

Re: molecular formulae

2012-01-06 Thread Mike Dewhirst
On 06/01/2012, at 8:03 PM, Russell Keith-Magee wrote: > On Fri, Jan 6, 2012 at 1:43 PM, Mike Dewhirst wrote: >> I think I have found a workaround but it will probably blow up in my face >> due to encoding/decoding things I don't fully understand. >> >> Can any

Re: molecular formulae

2012-01-06 Thread Mike Dewhirst
I agree. I was wrong to try anything with the non-numerics. They need to be left as the user entered them. Thanks Mike On 06/01/2012, at 8:46 PM, aastrand wrote: > Unfortunately, an automatic capitalization routine would not work in > general. Take Co (the element cobolt) and CO (the molecul

Re: molecular formulae

2012-01-06 Thread Mike Dewhirst
On 6/01/2012 8:03pm, Russell Keith-Magee wrote: On Fri, Jan 6, 2012 at 1:43 PM, Mike Dewhirst wrote: I think I have found a workaround but it will probably blow up in my face due to encoding/decoding things I don't fully understand. Can anyone comment on the robustness of callin

Re: molecular formulae

2012-01-06 Thread Mike Dewhirst
s my limit for now. :) Thanks Mike might do the job for you. Per-Olof On Jan 6, 1:41 pm, Mike Dewhirst wrote: I agree. I was wrong to try anything with the non-numerics. They need to be left as the user entered them. Thanks Mike On 06/01/2012, at 8:46 PM, aastrand wrote: Unfortu

collectstatic missing on Linux

2012-01-09 Thread Mike Dewhirst
The manage.py collectstatic subcommand doesn't exist on my Linux staging server but it does exist (and works) on my Win XP development machine. I'm using exactly the same settings.py on both machines. On Linux, in a Python interpreter I can do ... >>>from django.contrib import staticfiles >>>

[Solved] collectstatic missing on Linux

2012-01-10 Thread Mike Dewhirst
Thanks guys - I found the problem. It required the following in manage.py ... import os, sys if __name__ == "__main__": SRC_ROOT = os.path.realpath(os.path.dirname(__file__)).replace('\\','/') PROJECT_ROOT = os.path.split(SRC_ROOT)[0].replace('\\','/') sys.path.append(PROJECT_RO

scheduling in future

2012-01-10 Thread Mike Dewhirst
What is the best way to schedule future events in Django? I have a table with future dates and user info. When date==today I want Django to send an email to that user. Ideas? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: scheduling in future

2012-01-10 Thread Mike Dewhirst
PM, "Mike Dewhirst" mailto:mi...@dewhirst.com.au>> wrote: What is the best way to schedule future events in Django? I have a table with future dates and user info. When date==today I want Django to send an email to that user. Ideas? Thanks Mike --

Re: Staging (dev,test,prod) in django

2012-01-12 Thread Mike Dewhirst
On 12/01/2012 8:55pm, Thomas Guettler wrote: Hi, How do you handle staging? - Deploy the source code and static files dev (winXP) commit to svn (linux) svn wakes up buildbot (same linux) buildbot wipes out the test site (same linux) buildbot rebuilds the test site (including collectstat

Re: Open-source or closed-source for SaaS?

2012-01-15 Thread Mike Dewhirst
On 16/01/2012 3:09pm, Alec Taylor wrote: Initially I was going closed-source all the way, or at least until we have a good reputation, and open-sourcing will only improve that rep. Recently though, I've been thinking about open-sourcing the entire solution. Various popular SaaS solutions have o

pseudo one-to-one

2012-01-15 Thread Mike Dewhirst
I need a one-to-many to behave like a one-to-one. The parent instance of my model can only ever have one current child instance of another model. Multiple child instances have to exist and be kept for the historical record. The main benefit of one-to-one relationships is that they can be mapp

Re: pseudo one-to-one

2012-01-15 Thread Mike Dewhirst
'hidden' field which gets updated on saving based on the existence of a more modern child. Dunno. Thanks Mike Bill Beal On Mon, Jan 16, 2012 at 12:55 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: I need a one-to-many to behave like a one-to-one. The paren

Re: pseudo one-to-one

2012-01-16 Thread Mike Dewhirst
x27;t work I'll try and filter out all children except for the current one and then, in the form for the only visible child, find a way to navigate forward to the not-yet-current one and backward to the immediate predecessor. Thanks Bill Mike Bill On 1/16/12, Mike Dewhirst wrote

Re: pseudo one-to-one

2012-01-16 Thread Mike Dewhirst
2, at 2:18 AM, Mike Dewhirst wrote: On 16/01/2012 5:19pm, Bill Beal wrote: Why not have a child model that differs from the one-to-one child model in that the parent key is now a foreign key to the parent? When another child needs to replace the current one in the one-to-one relationship, move th

Re: pseudo one-to-one

2012-01-16 Thread Mike Dewhirst
needs to chain from child to child. If they are entered in chronological order, the IDs will be in numerical order, or else you can add a field to order them. Bill - this is the direction I'm now taking. Thanks one and all. Cheers Mike On Mon, Jan 16, 2012 at 6:06 PM, Mike Dewhirst

ImageField filename

2012-01-18 Thread Mike Dewhirst
How do I get the actual filename of the uploaded image? The docs mention ... FileField.upload_to A local filesystem path that will be appended to your MEDIA_ROOT setting to determine the value of the url attribute. ... and presumably the widget which uploads the image knows the filename to t

Re: file manager options for user home directory

2012-01-18 Thread Mike Dewhirst
On 19/01/2012 2:10pm, Brian Schott wrote: Looking for some expert advice. I need to provide an upload and file browse capability for a user's home directory. It doesn't have to be a full blown file explorer necessarily, just a basic upload, download, rename, delete. What's the best way to deal

Re: file manager options for user home directory

2012-01-19 Thread Mike Dewhirst
round the barn and am missing an obvious way to for web-based file management for user's files... On Jan 19, 2012, at 12:56 AM, Mike Dewhirst wrote: On 19/01/2012 2:10pm, Brian Schott wrote: Looking for some expert advice. I need to provide an upload and file browse capability for a user&#x

Re: Model-driven Django development

2012-01-21 Thread Mike Dewhirst
On 21/01/2012 2:50pm, Alec Taylor wrote: At University I've learned various techniques for model-driven developments, such as: - Class diagrams (generate code) - ERD Diagrams (generate db code [e.g. SQL]) Check out Dia which has a Python script interface and I seem to remember someone doing a

Re: Deverifying a URLField

2012-01-24 Thread Mike Dewhirst
On 25/01/2012 10:30am, Rich Jones wrote: Hello, all! I have a small conundrum I could use a hand with. I have a deployed Django application with a Model which has a URLField: project_homepage = models.URLField('Project Homepage', blank=True) How about ... project_homepage = models.URLField(

Re: How to implement pre-save operations for inlines in the admin interface?

2012-11-15 Thread Mike Dewhirst
On 16/11/2012 3:52am, Arnold Krille wrote: Why do you want to do this only in the admin interface? Its a generic thing: every time you save/change a period you should set the end-date of the previous one. So I would do this with a post-save hook (aka signal) directly in the models.py. Or maybe ev

Re: How to implement pre-save operations for inlines in the admin interface?

2012-11-15 Thread Mike Dewhirst
Thanks Arnold - makes sense. Cheers Mike On 16/11/2012 11:01am, Arnold Krille wrote: On Fri, 16 Nov 2012 08:43:04 +1100 Mike Dewhirst wrote: On 16/11/2012 3:52am, Arnold Krille wrote: Why do you want to do this only in the admin interface? Its a generic thing: every time you save/change a

no need to syncdb

2012-11-15 Thread Mike Dewhirst
I just discovered something fantastic about Django I didn't know before. I realise that isn't saying much about my knowledge. But I'm impressed. I recently wrote a new model and put in a lot of time making it do stuff and writing the tests to prove it worked. I realised I had forgotten to sync

Re: psycopg2

2012-11-18 Thread Mike Dewhirst
A very useful resource for Windows users is http://www.lfd.uci.edu/~gohlke/pythonlibs/ ... where you can download the compiled psycpg2 package you need. Also, I prefer pip rather than easy-install Good luck. Mike On 18/11/2012 6:36pm, Jun Tanaka wrote: Thank you for your advise. I used t

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst
On 1/12/2012 3:48pm, Loai Ghoraba wrote: I have ran chmod o+rx on the root directory, isn't this enough (isn't chmod applied to all folders down recursively ?) ? No. You need chmod -R o+rx and I have checked the directories from the root down to static, all have the permission of drwxr-xr-x

Re: Django apache mod_wsgi permission denied

2012-11-30 Thread Mike Dewhirst
On 1/12/2012 3:57pm, Loai Ghoraba wrote: thanks, but I have tried this now and it also doesn't work :X though the author slides presentation mentioned chmod o+rx on the root dir only. On Sat, Dec 1, 2012 at 6:53 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: chmod -R

Re: Model method versus overriding save()

2012-12-09 Thread Mike Dewhirst
On 9/12/2012 5:54pm, Thomas Lockhart wrote: On 12/8/12 5:37 AM, Derek wrote: Rather than use a trigger (which is DB-specific and also hard to debug because not part of your code base), suggest you use signals[1]. Hmm. Triggers have advantages over application-level code where they can be used.

Re: Model method versus overriding save()

2012-12-09 Thread Mike Dewhirst
On 10/12/2012 10:59am, Victor Hooi wrote: Also - in terms of using them with QuerySets - there aren't any workarounds to use model methods with QuerySets are there? It seems like that would be a definite argument in favour of using the second method, right? I'm not sure what you mean exactly he

validation error in Django Admin

2012-12-12 Thread Mike Dewhirst
I'm getting an unexpected validation error in Admin which baffles me. Any hints appreciated ... here is the traceback http://dpaste.com/844972/ At the bottom of the traceback where the error is raised, the local vars are ... self value u'33' key 'pk' When I save the item, it auto-

[Solved] validation error in Django Admin

2012-12-13 Thread Mike Dewhirst
u might have better luck if you're using a OneToOne or ForeignKey (onetomany), which will let django manage that relationship for you. On Wednesday, December 12, 2012 4:21:59 PM UTC-8, Mike Dewhirst wrote: I'm getting an unexpected validation error in Admin which baffles me. Any hints a

trouble with pre_delete signal method

2012-12-16 Thread Mike Dewhirst
I'm getting a baffling ValidationError. Request URL:http://127.0.0.1:8000/admin/assembly/item/4/ Django Version: 1.4.3 Exception Type: ValidationError Exception Value: [u'Select a valid choice. That choice is not one of the available choices.'] Exception Location: C:\usr\

Re: trouble with pre_delete signal method

2012-12-18 Thread Mike Dewhirst
ome of the models and I removed all that as well. As mentioned earlier, embedded print statements seem to prove the delete_bparts() code is working nicely. When I comment out the pre-delete connection, the A_Part record gets delete as expected - but obviously it doesn't clean up the B re

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
On 19/12/2012 12:06am, Thomas Orozco wrote: I think you have a ForeignKey field that is required or limited and that is causing the ValidationError. Indeed, that line 988 is in the code for ModelChoiceField I have now been through the entire application and adjusted *ALL* foreign keys to be n

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
vious! : ) Ok - I'll try and cut it down somewhat which might take a while. And who knows whether that might even fix the problem hey??? Back soon and many thanks for the focus Mike Cheers, Thomas 2012/12/19 Mike Dewhirst mailto:mi...@dewhirst.com.au>> On 19/12/2012 12

Re: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
ace. Last, would you mind sharing the bpart.a_partcodes code ? Cheers, Thomas 2012/12/19 Mike Dewhirst : Thomas Thanks for replying On 19/12/2012 12:06am, Thomas Orozco wrote: Hi, Could you provide the following information? - What's the relationship between A and B (mod

[Solved]: trouble with pre_delete signal method

2012-12-19 Thread Mike Dewhirst
On 20/12/2012 10:59am, Mike Dewhirst wrote: On 19/12/2012 11:58pm, Thomas Orozco wrote: Hi, If you have no relationship, I'm a bit at a loss. I think the easier way would be to use a debugger if possible. I think we need to know what field is causing the ValidationError. The line t

Re: Converting Django app into a Desktop app

2012-12-20 Thread Mike Dewhirst
See also https://us.pycon.org/2012/schedule/presentation/393/ by Ryan Kelly and his 'esky' package for safely updating distributed apps. There is a link to that and other items in the above pycon talk. Mike On 21/12/2012 9:55am, Filip Wasilewski wrote: Hi, On Tuesday, December 18, 2012 5:06

Re: Change label/title from an application added to django admin

2012-12-23 Thread Mike Dewhirst
On 24/12/2012 9:02am, Emiliano Dalla Verde Marcozzi wrote: Hello, I created an app called 'emp' with the command: django-admin.py startapp emp. Then, i edited my models.py, added an admin.py file to register my clases/models in the django admin. Now, when i login into the django admin, i have a l

Re: Django asset management and dynamically created databases

2012-12-23 Thread Mike Dewhirst
On 24/12/2012 8:10am, Chad Vernon wrote: Hi there, I'm designing a database for an animation studio to track assets across multiple shows. We potentially would want each show to have its own database, however we would want functionality to search for assets across all shows. It would *much* si

Re: How do I create timestamp type columns in (mySQL) database?

2012-12-26 Thread Mike Dewhirst
On 27/12/2012 2:40am, Subodh Nijsure wrote: I am working with situation where I would like to maintain timestamp (in UTC) of when a record is created or updated. I can't help with MySQL but Postgres makes it easy. If you syncdb a models.DateTimeField, Postgres (or more correctly, the Postgres

Re: Serving static files: Tried 3 ways with no luck

2012-12-26 Thread Mike Dewhirst
On 27/12/2012 2:03pm, warsam...@gmail.com wrote: I am having an unbelievable time getting my new django application to servie static files, i have read the django documentation but it seems as there isn't one consistent way to serve static files while in development using the Django server. In o

Re: manage.py collectstatic?

2012-12-28 Thread Mike Dewhirst
On 29/12/2012 6:32pm, Derek wrote: When I run this command, I get: You have requested to collect static files at the destination location as specified in your settings. This will overwrite existing files! Are you sure you want to do this? Q1: Where is this location specified in settings? se

Re: Design by composition and persistance

2012-12-28 Thread Mike Dewhirst
On 29/12/2012 4:44pm, Taras_96 wrote: Hi, I'm stuck on the best way of implementing design by composition in Django, and was wondering if anyone had any suggestions/pointers/past experiences. Design by compositon is what you do before thinking about Django. The outcome would be, well, a desig

Re: Design by composition and persistance

2012-12-29 Thread Mike Dewhirst
On 29/12/2012 7:39pm, Taras_96 wrote: f we map software objects directly onto Django Models, then we'd end up with a TimeWindow table, where each row would only ever be referenced by exactly one Event. My understanding of the advantage of normalisation is that it prevents data duplication, and th

Re: Creating a project error

2012-12-31 Thread Mike Dewhirst
On 1/01/2013 4:06pm, shaggy0n wrote: Hi i'm totally newby django user. When i trydjango-admin.py startproject mysite command i've got this error: . ...lib/python3.1/site-packages/django/utils/functional.py", line 349, in If you want to use Python 3.x you want Django 1.5.x and then you nee

Re: Can't set static file directory.

2013-01-08 Thread Mike Dewhirst
On 8/01/2013 10:03pm, joy wrote: I have the same problem, the tutorial speaks about a list of things to do: * Push your code up to the deployment server. * On the server, run collectstatic to

Re: How do I display a static image in my index.html file?

2013-01-13 Thread Mike Dewhirst
On 14/01/2013 2:18am, frocco wrote: I finally got this working. Why is it necessary to run collectstatic? in PHP, I would just point to the images. Consider that you might have a number of apps in your project. As an experienced Django dev you would probably keep your separate apps nicely se

w3c accessibility design

2013-01-16 Thread Mike Dewhirst
Has anyone tackled WCAG 2.0 in their Django apps? http://www.w3.org/WAI/WCAG20/quickref/Overview.php I have been asked to advise on a CMS for a client needing to provide access for people with various disabilities. The CMS needs a public section as well as an intranet for logged-in users. Th

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
On 24/01/2013 2:36am, frocco wrote: Hello, In my view, I am displaying rows of data that have a choice field in a form. one form for each row I want to change the choice this before printing. one row can have 1 to 5 choices another row can have 1 to 10 choices depending on values in each row.

Re: how do I dynamically modify a choice field

2013-01-23 Thread Mike Dewhirst
There are no choices for this row {% endfor %} {% endfor %} {% else %} Sorry, no list of row objects today! {% endif %} hth Mike On Wednesday, January 23, 2013 6:03:28 PM UTC-5, Mike Dewhirst wrote: On 24/01/2013 2:36am, frocco wrote:

Re: how do I dynamically modify a choice field

2013-01-24 Thread Mike Dewhirst
On 24/01/2013 10:30pm, frocco wrote: Thanks Mike, Since I am new to django, how would I code this? In my for loop, my row.stock field has a value. Lets say row.stock is 20 I want my choice field to show 1 to 20 The next row.stock might have 12 I want my choice field to show 1 to 12 In other

how to delete in the admin - strategy needed

2013-02-03 Thread Mike Dewhirst
This is the error ... Select a valid choice. That choice is not one of the available choices. I want to delete a bunch of "child" records when a "parent" record is deleted. While I'm using that terminology they are not actually related in the usual sense. All however are in foreign key relatio

Re: how to delete in the admin - strategy needed

2013-02-04 Thread Mike Dewhirst
ne place. The answer has to be in a models.Manager somewhere. I guess I need to dig deeper. Thanks Mike On Mon, Feb 4, 2013 at 2:14 AM, Mike Dewhirst wrote: This is the error ... Select a valid choice. That choice is not one of the available choices. I want to delete a bunch of "chil

Re: how to delete in the admin - strategy needed

2013-02-04 Thread Mike Dewhirst
delete signal of the Parent model. The purpose of the method is more or less documented below. I've tried this a number of different ways and always get the "Select a valid choice ..." error mentioned below. On 4/02/2013 6:14pm, Mike Dewhirst wrote: This is the error ... Select

Re: how to delete in the admin - strategy needed

2013-02-05 Thread Mike Dewhirst
/about.me/psjinx On Tue, Feb 5, 2013 at 12:15 PM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: Could someone please point out my mistake? def clean_out(self): child_lst = list(Child.objects.filter(__master=self.master,

Re: how to delete in the admin - strategy needed

2013-02-05 Thread Mike Dewhirst
effort - I'm sorry to waste your time. Mike On 6/02/2013 2:14pm, Mike Dewhirst wrote: Pankaj, thank you I have tried the code in a number of ways - including the way you wrote it[1] - and located in either Master[2] or Parent and it always runs to completion without raising its own exceptio

Re: Problen with Custom command and Bash Script

2013-02-06 Thread Mike Dewhirst
On 7/02/2013 12:39am, Jesús Lucas Flores wrote: Hey guys, I need a little bit help with a custom manage.py command called *test* There is already a manage.py subcommand called test. Might be an idea to rename your custom command and try again. Just a thought ... I am using it in a vi

Re: Access to data via many-to-many while in save()

2013-02-06 Thread Mike Dewhirst
On 7/02/2013 5:04pm, Derek wrote: I am trying to access the field(s) of a Child table while still inside the save method of the Parent table. Assuming that the many-to-many field in the Parent table is called `m2m_field`, and the field I need to access in the Child table is called `child_field`,

Re: Access to data via many-to-many while in save()

2013-02-07 Thread Mike Dewhirst
Much more clearly expressed here ... https://docs.djangoproject.com/en/1.4/topics/db/models/#extra-fields-on-many-to-many-relationships On 7/02/2013 5:04pm, Derek wrote: I am trying to access the field(s) of a Child table while still inside the save method of the Parent table. Assuming that t

django guru

2013-02-17 Thread Mike Dewhirst
I'm looking for a Django guru to help with some debugging. Please contact me off-list for details. I'm constrained by non-disclosure so I can't reveal anything on the list. Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: django guru

2013-02-18 Thread Mike Dewhirst
On 18/02/2013 6:50pm, Mike Dewhirst wrote: I'm looking for a Django guru to help with some debugging. As suggested by Russell here is some detail ... The design is moderately complex with all business rules built into model methods. The prototype is well advanced and based entire

looking for a Django app for annual subscriptions

2013-02-19 Thread Mike Dewhirst
Does anyone know of an annual subscriptions application for Django? I want to be able to offer a service to multiple organisations whereby their employees can subscribe to a serialised product which is paid for by subscription and each organisation can see what it is funding. I also want the o

Re: looking for a Django app for annual subscriptions

2013-02-20 Thread Mike Dewhirst
0:36:49 PM UTC-5, Mike Dewhirst wrote: Does anyone know of an annual subscriptions application for Django? If you aren't looking to handle all the payment processing yourself, Stripe <https://stripe.com/> has really good subscription/recurring support.

Re: Saving browser output as pdf

2013-02-23 Thread Mike Dewhirst
On 24/02/2013 4:04am, Satinderpal Singh wrote: How do i save the output from the browser as pdf. Is there any tool availabel with the django which can save the browser output to as pdf file. Chrome can save output as pdf all by itself. Other browsers (with plugins) might be able to do that as

Re: m2m relation just working in one direction

2013-02-24 Thread Mike Dewhirst
Roberto I'm not entirely sure but it is possible that your group is getting mixed up with the contrib.auth group. I would try changing the name of my group temporarily to something else just to eliminate that. Mike On 25/02/2013 8:58am, Roberto López López wrote: Hi, I have a problem invol

Re: Manually added foreign key not working.

2013-02-24 Thread Mike Dewhirst
On 25/02/2013 2:59pm, laxmikant ratnaparkhi wrote: Does anybody can answer this? Try changing your model from FK_Formats = models.ForeignKey(Formats) to ... FK_Format = models.ForeignKey(Formats)Â Â ... and see what happens to the error. Mike Let me know if anything extra is required?

Re: manage.py and django-admin.py help

2013-02-27 Thread Mike Dewhirst
On 28/02/2013 11:02am, Clientkill wrote: It appears that Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. I did a google search on this, but it reared no valuable results. Can anyone help? Your wsgi file (the server's entry-point for the site) needs

Re: Benchmarking and timing DB transactions in Django

2013-03-04 Thread Mike Dewhirst
There are a few interesting pages if you google 'scaling django' and here is one those ... https://speakerdeck.com/jacobian/django-doesnt-scale Mike On 5/03/2013 12:29am, Venkatraman S wrote: On Fri, Feb 22, 2013 at 4:48 PM, R R mailto:r01123581...@gmail.com>> wrote: I was wondering i

Re: Django 1.4.3 contact_form

2013-03-04 Thread Mike Dewhirst
On 5/03/2013 2:05pm, Ana Molf wrote: I can﹀ solve the follow error The error message says you have an indentation error. That means you need to make sure to have exactly the same quantity of indentation each time the source code gets indented. In practice, most people use four spaces and ne

Re: Is there any database ( or other ) magic going on with django properties?

2013-03-12 Thread Mike Dewhirst
On 12/03/2013 5:09pm, Doug S wrote: I'm considering using django properties on some models that are mostly tabulated numerical data. I'm want to derive some numerical scores from some of the columns of data I'm using as input. If I use properties for these derived scores, what is actually happeni

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 10:31am, Russell Keith-Magee wrote: On Fri, Mar 15, 2013 at 5:24 AM, Shawn Milochik mailto:sh...@milochik.com>> wrote: I've repeatedly asked about this over the past couple of years and there seems to be no "right" answer." This, to me, is the biggest flaw in Django.

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to resize my modelform fields on the template. They're bei

Re: resize modelform fields on template

2013-03-14 Thread Mike Dewhirst
On 15/03/2013 4:25pm, Mike Dewhirst wrote: On 15/03/2013 11:05am, cabrazil wrote: Hi, I have the same problem. Have you recieved any help? Thanks. Em segunda-feira, 3 de setembro de 2012 07h09min22s UTC-3, mapapage escreveu: Hi all! I'd like to know if there's a way to

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-15 Thread Mike Dewhirst
On 15/03/2013 4:56pm, Russell Keith-Magee wrote: On Fri, Mar 15, 2013 at 11:58 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote: What is the right way to design a system whereby on every save for every model the updated_by column is changed to the user.id <http://user.i

Re: how do I order a selection box in admin?

2013-03-15 Thread Mike Dewhirst
On 16/03/2013 1:59am, frocco wrote: Hello, I have a product record that can be assigned multiple categories. The problem I am having is the category list is not sorted by name. how can I sort the list in admin when I try and add a new product? Have you seen ... https://docs.djangoproject.com/

How to get ten random records

2013-03-18 Thread Mike Dewhirst
No really, I want a maximum of ten random records from the database (Django 1.4, Postgres 9.1). Looking at the docs this seems to be what I want ... Items.objects.filter(name__icontains=term).order_by('?')[:10] Is there a better way? Would .order_by() be quicker if I wasn't too concerned

Re: How to get ten random records

2013-03-18 Thread Mike Dewhirst
On 19/03/2013 3:29pm, Christophe Pettus wrote: On Mar 18, 2013, at 9:03 PM, Mike Dewhirst wrote: No really, I want a maximum of ten random records from the database (Django 1.4, Postgres 9.1). This is a case where the raw SQL interface might be the right answer: you can just tack an ORDER

Re: How can I get around required fields in admin?

2013-03-19 Thread Mike Dewhirst
On 20/03/2013 12:23am, Javier Guerra Giraldez wrote: On Tue, Mar 19, 2013 at 8:13 AM, frocco wrote: These required fields will not have data until a user checks out. then they're not required from a database point of view. regardless of that, they can be required on a form. or you can pr

Re: Django split setting and environment variables

2013-03-21 Thread Mike Dewhirst
On 22/03/2013 7:58am, Alan Johnson wrote: I think hardcoding local machine development passwords is fine, but it's still better to store the production passwords in a key-value file that stays out of source control and is permissioned such that only authorized developers can directly access the s

First ever DjangoCon AU - precedes Pycon-au in Hobart in early July

2013-04-02 Thread Mike Dewhirst
All Just forwarding the Pycon-au notice for obvious reasons ... "This year we're welcoming the Python on OpenStack day, and the first ever DjangoCon AU. These will happen on Friday July 5, just before the CodeWars Tournament, where we'll pit teams of developers against each other on the big s

Re: General Apache Deploy Strategy

2013-04-02 Thread Mike Dewhirst
On 3/04/2013 1:04am, Sells, Fred wrote: We use django for intranet applications. There is minimal coupling between applications and we generally dedicate a virtual server for each application. Perhaps not the most efficient, but it works for our environment. In django 1.3 I just copied the “si

foreign key with unique versus one-to-one

2013-04-03 Thread Mike Dewhirst
I have noticed that there appears to be no difference in Postgres between a OneToOneField and a ForeignKey with unique=True Is there any/much difference in Django? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fr

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