Re: Trying to understand Django and Python from a C++ perspective

2009-06-30 Thread Lachlan Musicman
On Wed, Jul 1, 2009 at 06:02, zweb wrote: > > What book or resource would you recommend to learn advanced Python? > (other than python docs) "How to think like a computer scientist": http://www.greenteapress.com/thinkpython/ -- "I'm in IT and we generally know how to use

Date format errors and date defaults

2012-05-06 Thread Lachlan Musicman
I'm getting an error I don't quite understand how to solve - despite having USE_L10N = True DATE_FORMAT=('j N, Y') DATE_INPUT_FORMATS=('%d %B %Y') in my settings.py, the SelectDateWidget still renders in Month/Day/ Year order instead of day/month/year? Also, is there a way to set the default

Generic Views with flair?

2012-05-06 Thread Lachlan Musicman
I've happily worked out how to work @login_required for entries in views.py, but since the latest tutorial (which I followed) recommends moving to the Generic Views my code is now like this: urls.py ... url(r'^people/$', ListView.as_view(

Filter by retirement age?

2012-05-08 Thread Lachlan Musicman
Hola, I have a model Person with a dob = models.DateField() I would like to filter by age - in particular only include people less than 60 years old. I am having no luck getting the syntax right and was looking for pointers? queryset=Person.objects.filter(dob__year__gte =

Re: Filter by retirement age?

2012-05-09 Thread Lachlan Musicman
standard lib use of from_date.replace - is there a norm regards where a small utility like that would be put? It feels wrong putting it in [views|admin|models|url].py ..? cheers L. On Wednesday, May 9, 2012, Tom Evans wrote: > On Wed, May 9, 2012 at 12:12 AM, Lachlan Musicman > <data...@

Re: Filter by retirement age?

2012-05-09 Thread Lachlan Musicman
> > _Nik > > On 5/8/2012 4:12 PM, Lachlan Musicman wrote: > > Hola, > > I have a model Person with a dob = models.DateField() > > I would like to filter by age - in particular only include people less > than 60 years old. > > I am having no luck getting

Search in Django

2012-05-09 Thread Lachlan Musicman
Hi, I want to implement search in my django project. Looking around, I see lots about Haystack. I looked at Whoosh for the backend, but then I saw a tutorial for Djapian/Xapian that made the whole thing look dead simple. Also, since then I've discovered that Whoosh is lightweight and while the

Admin plugins

2012-06-13 Thread Lachlan Musicman
Hola, I just watched a video from last year about modifying the Django Admin interface. I was wondering if people recommend any particular app? Grappelli and django-admin-tools are both still being developed. Are there any others and if you prefer one, why? Am thinking especially in terms of

Re: Admin plugins

2012-06-14 Thread Lachlan Musicman
nd check them out cheers L. > > best, > patrick > > > Am Donnerstag, 14. Juni 2012 00:33:00 UTC+2 schrieb Lachlan Musicman: >> >> Hola, >> >> I just watched a video from last year about modifying the Django Admin >> interface. I was wondering if

Re: New to DJANGO

2012-06-24 Thread Lachlan Musicman
On Thu, Jun 21, 2012 at 9:37 PM, LJ wrote: > I started out learning Django using the "Writing your first Django app" > article: > https://docs.djangoproject.com/en/dev/intro/tutorial01/ > This is a very well-written tutorial that goes through each part in detail. > Please

Re: Uninstall for clean install

2012-06-24 Thread Lachlan Musicman
Thomas, If you've ever wanted to know why vitualenv is a good idea - here's a great reason. Since it compartmentalises everything - packages the whole deal, you can just create a new virtualenv and start developing. http://www.arthurkoziel.com/2008/10/22/working-virtualenv/ Cheers L. On Sun,

Re: Same virtual-env for all django projects

2012-07-02 Thread Lachlan Musicman
On Tue, Jul 3, 2012 at 10:52 AM, Smaran Harihar wrote: > Hi Djangoers, > > I am using virtual-env for my django project and I wanted to know that is it > ok to use the same virtual-env for all the django projects on my system? > > or do I need to create a virtual-env for

Re: migration via south for inheritance change -> please help

2012-07-04 Thread Lachlan Musicman
I'd like to know this too - but I think the real answer is "get better at python" - you are essentially (from what I can tell) in a django shell when south pops the "not blank, not null but no data" error - try pulling in some details from fixtures? cheers L. On Thu, Jul 5, 2012 at 2:30 AM,

Adding more data to Generic Views

2012-07-30 Thread Lachlan Musicman
Hola, I'm confused about adding extra content to a class based Generic View. I've read the docs at file:///home/datakid/src/django-docs/topics/class-based-views.html and have written the code accordingly. I have Person, Certificate, Job and Compensation objects. The last three all have an FK (or

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Tue, Jul 31, 2012 at 11:15 PM, Karl Sutt wrote: > So, in conclusion, Lachlan, you would want to do something like: > > def get_context_data(self,**kwargs): >> #Call the base implementation first to get a context >> context = super(PersonDetailView,

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Wed, Aug 1, 2012 at 12:43 AM, Melvyn Sopacua <m.r.sopa...@gmail.com>wrote: > On 31-7-2012 6:17, Lachlan Musicman wrote: > > > I have Person, Certificate, Job and Compensation objects. The last three > > all > > have an FK (or M2M) back to a (or some) Person(s)

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Wed, Aug 1, 2012 at 8:45 AM, Lachlan Musicman <data...@gmail.com> wrote: > On Wed, Aug 1, 2012 at 12:43 AM, Melvyn Sopacua <m.r.sopa...@gmail.com>wrote: > >> On 31-7-2012 6:17, Lachlan Musicman wrote: >> >> > I have Person, Certificate, Job and Compen

Created & updated date/time in models

2012-08-08 Thread Lachlan Musicman
Hola, I've got a bunch of date dependent data that I will need to analyse as the years go by. So adding create_date and update_date fields seems like the thing to do. I go researching I and I see that there are debates about whether auto_now_add and auto_now are useful or whether they should be

Re: Created & updated date/time in models

2012-08-09 Thread Lachlan Musicman
On Thu, Aug 9, 2012 at 3:33 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > On Thu, 9 Aug 2012 09:02:39 +1200, Lachlan Musicman <data...@gmail.com> > declaimed the following in gmane.comp.python.django.user: >> >> From what I can see, the admin interface alrea

Re: Created & updated date/time in models

2012-08-12 Thread Lachlan Musicman
On Sun, Aug 12, 2012 at 12:06 PM, Melvyn Sopacua <m.r.sopa...@gmail.com> wrote: > On 8-8-2012 23:02, Lachlan Musicman wrote: > >> From what I can see, the admin interface already keeps this data for >> each object (exception: no create_date for data imported via fixtures &

Re: New to Django, Admin Page not Loading

2012-08-13 Thread Lachlan Musicman
On Tue, Aug 14, 2012 at 10:04 AM, judy ngai wrote: > Here is my urls.py page > > from django.conf.urls.defaults import patterns, include, url > from django.contrib import admin > admin.autodiscover() > > > urlpatterns = patterns('', > # Examples: > # url(r'^$',

Model method represented as non-editable field on object edit page

2012-08-13 Thread Lachlan Musicman
Hola, I have a Person object with Class Person(model.Models): ... def get_id(self): """ This returns the worker's reference number, or "worker ID" Think like a social security number Not kept in the database as it would be extraneous The 10 is

Re: Django 1.4 admin. Calendar widget appears for DateTimeField but not DateField

2012-08-16 Thread Lachlan Musicman
Grimmus, You haven't really given us a lot of information to work with. My suggestion is: 1. Try it in another browser or clear your cache and try again 2. Send some more information, by (for example) using a code inspector (show source, firebug, etc) to see if the jquery and template code is

Re: I LOVE THIS COMMUNITY!

2012-08-21 Thread Lachlan Musicman
+1 On Wed, Aug 22, 2012 at 10:49 AM, Babatunde Akinyanmi wrote: > Amen to that > > On 8/21/12, Mario Gudelj wrote: >> I just want to tell you guys that you're awesome! I've never seen a >> community which helps noobs so much and with so few

Model ChoiceField?

2012-08-30 Thread Lachlan Musicman
Hi, I was just wondering if there was any noticeable difference between the models.ChoiceField() and the models.CharField(max_length=x,)? In the documentation I have (offline, Django v1.4) a reference to: /path/django-docs-1.4-en/ref/forms/fields.html#django.forms.ChoiceField.choices But in

Re: Model ChoiceField?

2012-08-30 Thread Lachlan Musicman
Ok, ignore this email - I've just realised one is a Form field, and the other is a Model field. Apols for stupid. Cheers L. On Fri, Aug 31, 2012 at 1:09 PM, Lachlan Musicman <data...@gmail.com> wrote: > Hi, > > I was just wondering if there was any noticeable dif

Re: To Use or Not to Use the admin backend

2012-09-03 Thread Lachlan Musicman
On Tue, Sep 4, 2012 at 3:38 AM, Frankline wrote: > Hi, > > I'm creating a site in Python/Django and feel that the admin backend, as > good as it is, may not be a one-fit-for-all situations. > > My question is this: > > Have any of you ever had a need to have a custom admin

Re: To Use or Not to Use the admin backend

2012-09-03 Thread Lachlan Musicman
Oh, and I forgot to mention, there's this video: http://python.mirocommunity.org/video/1861/djangocon-2010-customizing-the which I watched recently - it's a bit old, but interesting none the less cheers L. -- You received this message because you are subscribed to the Google Groups "Django

'str' object is not callable in base.py

2012-09-03 Thread Lachlan Musicman
Hi all, Stumped on this one: Traceback: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/tafe/timetable/2012-4/ Django Version: 1.4 Python Version: 2.7.3 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions',

Re: To Use or Not to Use the admin backend

2012-09-04 Thread Lachlan Musicman
On Wed, Sep 5, 2012 at 1:50 AM, Tomas Neme wrote: > I've a question about this. I tried to do something like this, but > using the main capabilities and hacking on the ModelAdmin classes, > changing the formsets and the like, and reusing as much as possible, > including of

Re: 'str' object is not callable in base.py

2012-09-04 Thread Lachlan Musicman
On Tuesday, September 4, 2012, zayatzz wrote: > From this post i can see this line beeing wrong . > > timetable = get_object_or_404(slug=slug) > > You also need to give object as one of the parameters for > get_object_or_404 shortcut: like this : > >

Re: 'str' object is not callable in base.py

2012-09-04 Thread Lachlan Musicman
On Wednesday, September 5, 2012, Bill Freeman wrote: > My best guess is that, for whatever reason, 'timetable_view' in your url > conf > has not been converted into the view function. Try actually importing the > view in urls.py and putting it as the target of the pattern *without* > the quotes.

Override save or other options?

2012-09-10 Thread Lachlan Musicman
Hi All, Simplistically, I have an event type model (for a "school class") with a date field. On saving of the first event, I want to add recurring objects. Specifics for this project are "up to a latest date" (ie, end of term) and "recur weekly only" (not daily, monthly, yearly, etc - for the

Re: Override save or other options?

2012-09-11 Thread Lachlan Musicman
On Tue, Sep 11, 2012 at 5:15 PM, Jani Tiainen wrote: > > Rather than creating individual series of events from recurring I would do a > concept called "recurring event". So it would be just a single event that is > projected to spesific days as necessary. It requires a slightly

Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
Hi Is there anyway to import the choices from my models.py into my forms.py to prevent code duplication? At the moment I've got the following, but I'm getting invalid sytax errors in my forms.py: models.py : SESSION_CHOICES = ( (u'0',u'Morning 1'), (u'1',u'Morning

Re: Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
l.ordered_by('-date')) >> # added a ) >> >> >> >> >> On Tue, Sep 11, 2012 at 9:26 PM, Lachlan Musicman <data...@gmail.com> >> wrote: >>> >>> Hi >>> >>> Is there anyway to import the choices f

Re: Override save or other options?

2012-09-11 Thread Lachlan Musicman
inside the view. If you create > a series model and use it as a foreign key in your event to keep on top of > everything it should work. You mean it should work with keeping per-date attendance records you mean? cheers L. > > -m > > On 12 September 2012 07:31, Lachlan M

ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Lachlan Musicman
Hola As per subject - I'm getting ViewDoesNotExist errors on a view that does exist. I've checked the spelling, indenting and it all seems legit. If I comment out the two lines that call the view in question from urls.py, everything is back to normal. --- tafe/urls.py from django.conf.urls

Re: ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Lachlan Musicman
Grrr - sorry sent before I was finished. tafe/views.py # Create your views here. from tafe.models import Session from tafe.forms import SessionRecurringForm from django.shortcuts import render_to_response from django.http import HttpResponseRedirect import datetime def session_create(request):

Re: ViewDoesNotExist !?!?! It certainly does....

2012-09-12 Thread Lachlan Musicman
On Wed, Sep 12, 2012 at 6:19 PM, Sergiy Khohlov wrote: > add to urls > from tafe.views import session_create Thanks. I actually found this solution late late last night while offline, buried deep in the docs:

Re: Problem Accessing Admin Pages

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 7:40 AM, bml1rules wrote: > Hey Guys! > > I am the webmaster of a Django database and I recently ran into a snag. We > have an admin section with about 15 privileges. All of a sudden, almost all > of them are gone. I've tried getting to them by

get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
Hi, I'm getting blank get_absolute_url problems that I just can't solve. I can get to an object by actually visiting the url that would be constructed - I've checked that: app/session/year/month/day/slug models.py: class Session(models.Model): ... @models.permalink def

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 1:38 PM, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Fri, Sep 14, 2012 at 9:07 AM, Lachlan Musicman <data...@gmail.com> wrote: >> Hi, >> >> I'm getting blank get_absolute_url problems that I just can't solve. I >> ca

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:05 PM, Lachlan Musicman <data...@gmail.com> wrote: > On Fri, Sep 14, 2012 at 1:38 PM, Russell Keith-Magee >> Something is going wrong in the reversing process, which is raising an >> exception, which is silently swallowed by the get_absolute_url call.

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
> How do I call reverse in the shell? Import it and...? > > reverse(s)? Gah, should have tried that before sending: >>> from django.core.urlresolvers import reverse >>> reverse(s) Traceback (most recent call last): File "", line 1, in File

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:47 PM, Lachlan Musicman <data...@gmail.com> wrote: >> How do I call reverse in the shell? Import it and...? >> >> reverse(s)? > > Gah, should have tried that before sending: > >>>> from django.core.urlresolvers import reverse

Re: get_absolute_url is returning '' instead of url

2012-09-13 Thread Lachlan Musicman
On Fri, Sep 14, 2012 at 2:53 PM, Russell Keith-Magee <russ...@keith-magee.com> wrote: > On Fri, Sep 14, 2012 at 10:47 AM, Lachlan Musicman <data...@gmail.com> wrote: >>> How do I call reverse in the shell? Import it and...? >>> >>> reverse(s)? >&g

Abstract classes and inhertience

2012-09-16 Thread Lachlan Musicman
Hola, I have an abstract base class, Person, with three children: Applicants, Students and Staff. I have two questions. As per docs ($PATH/topics/db/managers.html#custom-managers-and-model-inheritance) I have three managers for the Abstract class: people = models.Manager() men = MaleManager()

Confused by BooleanField

2012-09-18 Thread Lachlan Musicman
Hola, I've written a form that has two BooleanFields on it. They render as text boxes on the page, which is great. All my initial testing included checking the boxes for the two BooleanFields as this is the major use case. I just did a test in which I didn't check the boxes, and I'm getting

Re: date display problem?

2012-09-18 Thread Lachlan Musicman
On Wed, Sep 19, 2012 at 2:34 PM, Navnath Gadakh wrote: > i have post date variable to view? but when i retrieve date from database . > not displaying on browser We need more information than that - do you mean it's not displaying in a form, in a regular template or in

Re: Confused by BooleanField

2012-09-18 Thread Lachlan Musicman
Ignore - I've found the documentation. PATH/ref/forms/fields.html#booleanfield required=False cheers L. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from

Re: date display problem?

2012-09-18 Thread Lachlan Musicman
On Wed, Sep 19, 2012 at 3:51 PM, Navnath Gadakh wrote: > model >class Offer(models.Model): > effective_date = models.DateField() > expiration_date = models.DateField() Nothing wrong here > view.py > HTML = HTML + "" >

Re: date display problem?

2012-09-19 Thread Lachlan Musicman
On Wed, Sep 19, 2012 at 10:19 PM, Navnath Gadakh wrote: > i am fetching multiple rows? > i have already used > for offer in offers: > print offer.effective _date > but didnt work.my code is > my_offers = >

Strange rendering behaviour in template/user/auth

2012-09-20 Thread Lachlan Musicman
Hola, I've noticed for a while that my home/index page wasn't registering the {{ user }} tag when rendering the page: there was no "Welcome Username. Change password / Log out" in the top right corner, and the link to the admin interface that I'd put in the breadcrumbs for logged in users

Re: Strange rendering behaviour in template/user/auth

2012-09-20 Thread Lachlan Musicman
guess I just add something similar? ...OK, I just added exactly the same as for the CSRF and it worked - thanks Hevok! cheers L. > > Bests, > Hevok > > > On Friday, September 21, 2012 12:20:04 AM UTC+2, Lachlan Musicman wrote: >> >> Hola, >> >> I've no

Re: Strange rendering behaviour in template/user/auth

2012-09-20 Thread Lachlan Musicman
this needs to be better placed, or to have better examples. Or maybe that's exactly what the list/IRC is for :) Cheers L. > > Cheers, > Hevok > > > > On Friday, September 21, 2012 12:50:13 AM UTC+2, Lachlan Musicman wrote: >> >> On Fri, Sep 21, 2012 at 10:29 A

Re: How to extend the TextField in Django?

2012-09-20 Thread Lachlan Musicman
What you are looking for is called a WYSIWYG editor widget - there are a couple of extentions/plugins lying around: http://djangosnippets.org/snippets/1705/ or http://blog.bixly.com/post/22376374604/django-tinymce-a-wysiwyg-editor-for-django or https://github.com/pydanny/django-wysiwyg/ or

Re: A lots of foreign keys - Django Admin

2012-09-24 Thread Lachlan Musicman
I'm not an expert on this matter, but I did read about list_select related recently: /path/django-docs-1.4-en/ref/contrib/admin/index.html#django.contrib.admin.ModelAdmin.list_select_related which links to select related:

View.py v models.py

2012-09-26 Thread Lachlan Musicman
Hi I was doing some work on a view last night and realised that the code could go into either views.py or as a method on the model. Do people have internal guidelines about when they make something a method on a model rather than a view function? Is there any functional difference apart from the

Re: View.py v models.py

2012-09-26 Thread Lachlan Musicman
On Thu, Sep 27, 2012 at 10:59 AM, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Wed, Sep 26, 2012 at 5:50 PM, Lachlan Musicman <data...@gmail.com> wrote: >> Do people have internal guidelines about when they make something a >> method on a model rather than a

conditional model validation

2012-09-27 Thread Lachlan Musicman
Hola, I'm searching without much luck and can't see the answer in the docs. Am wanting to override the is_valid() method on a model (I think that's what I want). Basically, I have a choices field, and if one of those choices is selected, then I want a description field to be not blank/not the

last changed by User

2012-09-27 Thread Lachlan Musicman
Hola, I wanted to display the user that last changed a model instance. It's hard to search for because the username/email-as-login makes up the majority of the search results. Despite this, I've found a couple of pages, with this being the most like what I want:

Re: last changed by User

2012-09-27 Thread Lachlan Musicman
On Friday, September 28, 2012, Lachlan Musicman wrote: > > I wanted to display the user that last changed a model instance. > > Despite this, I've found a couple of pages, with this being the most like > what I want: > > https://code.djangoproject.com/wiki/CookBookNewformsAd

Re: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Lachlan Musicman
On Fri, Sep 28, 2012 at 4:05 PM, Navnath Gadakh wrote: > ConfigParser.NoSectionError: No section: 'database' Off the top of my head, I would suggest you have nothing in the section DATABASES in your settings.py Does your settings.py have something that looks like:

Re: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Lachlan Musicman
On Fri, Sep 28, 2012 at 4:15 PM, Lachlan Musicman <data...@gmail.com> wrote: > On Fri, Sep 28, 2012 at 4:05 PM, Navnath Gadakh <navnathgad...@gmail.com> > wrote: >> ConfigParser.NoSectionError: No section: 'database' Although a quick google of the phrase is showing up l

Re: conditional model validation

2012-09-28 Thread Lachlan Musicman
> Check: https://docs.djangoproject.com/en/dev/ref/forms/validation/ > which is a link to the documentation on form validation > cheers - since I am using the admin forms, I was hoping I could add it to the model, but is ok if I need to rewrite the forms cheers L. > On 9/28/1

Like a Formset but not...

2012-10-03 Thread Lachlan Musicman
Hi, I am looking for a way to do something similar to a formset, but slightly different. I have a list of students in a class (class as a school subject, not class in programming) with attendance record objects having a FK to both student and class, as well as two fields with choices lists

Inlines defined before use?

2012-10-03 Thread Lachlan Musicman
Hola, I'm finding that if my inlines aren't defined before use in the admin.py, I'm getting the following errors: inlines=('MyModelInline',) "issubclass() arg 1 must be a class" Errors inlines=(MyModelInline,) "name 'MyModelInline' is not defined" This is a minor issue, easily solved by

Re: Managers, Queryset, inheritance and polymorphism

2012-10-08 Thread Lachlan Musicman
On Sat, Oct 6, 2012 at 3:14 AM, Amirouche wrote: > Héllo, > > I got a problem with manager, some of you may already know it, I try my best > to like them, if anyone can explain me the purpose of their existence I will > be so much grateful :) > > Like I said, I try

Re: Inlines defined before use?

2012-10-08 Thread Lachlan Musicman
rocedures, and others are django-wranglings. Cheers L. > > On Wed, Oct 3, 2012 at 5:58 PM, Lachlan Musicman <data...@gmail.com> wrote: >> Hola, >> >> I'm finding that if my inlines aren't defined before use in the >> admin.py, I'm getting the following errors: >

Re: Django testing strategy

2012-10-09 Thread Lachlan Musicman
This has been a very interesting thread - out of interest, does anyone have a preference for one of factory-boy or django-dynamic-fixture and why? They look similarly up to date and useful, but I've no idea how to differentiate them. cheers L. -- ...we look at the present day through a

Re: perfectionists... motto doesn't fit

2012-10-13 Thread Lachlan Musicman
On Sat, Oct 13, 2012 at 12:39 PM, Russell Keith-Magee wrote: >> Russell (and Jacob), >> >> I really appreciate the way you moderate the forum. I was thinking exactly this when I read Russell's first response. This is an excellently run community. Thankyou for your work

Overriding admin save event

2012-10-15 Thread Lachlan Musicman
Hola, I wanted to override the save event in the admin so that users were redirected to a different page. I found this page describing how to do it: http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html#listing10 It recommends two methods and describes one: "There are

Re: Overriding admin save event

2012-10-15 Thread Lachlan Musicman
On Tue, Oct 16, 2012 at 12:52 PM, Lachlan Musicman <data...@gmail.com> wrote: > Hola, > > I wanted to override the save event in the admin so that users were > redirected to a different page. Of course, further reading has turned up signals. Is this the current recommended

Re: Overriding admin save event

2012-10-15 Thread Lachlan Musicman
On Tue, Oct 16, 2012 at 1:44 PM, Lachlan Musicman <data...@gmail.com> wrote: >> Hola, >> >> I wanted to override the save event in the admin so that users were >> redirected to a different page. > > Of course, further reading has turned up signals. Is this the

Re: Overriding admin save event

2012-10-15 Thread Lachlan Musicman
On Tuesday, October 16, 2012, Lachlan Musicman wrote: > Hola, > > I wanted to override the save event in the admin so that users were > redirected to a different page. > > I found this page describing how to do it: > > http://www.ibm.com/developerworks/opensource

Re: Better feedback for admin users

2012-10-17 Thread Lachlan Musicman
On Thu, Oct 18, 2012 at 12:28 AM, Bill Freeman wrote: > On Tue, Oct 16, 2012 at 6:21 PM, Daniele Procida wrote: >> I am starting to customise the admin classes for my models so that I can >> provide extra feedback to the user. >> >> For example I want to

Re: Django Troubleshooting

2012-10-18 Thread Lachlan Musicman
On Fri, Oct 19, 2012 at 4:07 PM, Sun Simon wrote: > https://www.djangoproject.com/download/ > > I am installing Django for Python on Win XP and came across this problem > during installation: > > > tar xzvf Django-1.4.2.tar.gz > cd Django-1.4.2 > sudo python setup.py

urls.py and default values...

2012-10-21 Thread Lachlan Musicman
Hola, I have data across multiple years. I want to run reports on a per year basis, so I have in my urls: url(r'^students/reports/(?P\d{4})/$', student_reports, name='student_reports'), etc. What I want to know though, is how to have this in the urls: url(r'^students/reports/$',

Re: urls.py and default values...

2012-10-22 Thread Lachlan Musicman
nother option could be passing extra option to you view function: > https://docs.djangoproject.com/en/1.4/topics/http/urls/#passing-extra-options-to-view-functions > > > Cheers, > Tom > > Dne Mon, 22 Oct 2012 15:24:51 +1200 > Lachlan Musicman <data...@gmail.com> napsal(a):

Re: Modernizing the Tutorial

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 2:00 AM, Tomas Neme wrote: > Now that function-based views are being deprecated, or at least that > class-based views are being favored, there should be a tutorial with > them in the docs, shouldn't it? > > I don't mean replacing the current one,

Re: Modernizing the Tutorial

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 1:02 PM, Tomas Neme wrote: >> However, there is also scope for a focussed tutorial about class-based views >> in general. IMHO one of the biggest uptake problems around class-based > > This is what I meant. Something that brings in, easy and clearly,

Re: Installing Djando and tutor polls app

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 10:39 AM, Rodrigo Morgado wrote: > Hi everybody, > > I'm new in Django framework. I installed version 1.3.1 over Python 2.7.3 in > Ubuntu. > I already did all steps but i have an error when i execute python manage.py > sql polls to create

Documentation Bug report

2012-10-28 Thread Lachlan Musicman
Hola, After the thread about improving the Class based View documentation someone pointed us to the dev docs, which I downloaded to read (low bandwidth area, plus intermittent network and power availability). I downloaded the zip from the HTML link on the front page. The new docs are great -

Re: Documentation Bug report

2012-10-28 Thread Lachlan Musicman
ethod in the process)." Should have s/On/In/g cheers L. On Mon, Oct 29, 2012 at 10:05 AM, Ramiro Morales <cra...@gmail.com> wrote: > On Sun, Oct 28, 2012 at 4:34 PM, Lachlan Musicman <data...@gmail.com> wrote: >> >> The funniest/worst part is the title: >> >

Re: Django Development Model

2012-10-28 Thread Lachlan Musicman
On Mon, Oct 29, 2012 at 9:39 AM, Smriti Patodi wrote: > Hi Everyone, > I am a MSIS student at Santa Clara University, CA. My team has chosen Django > to work on for our Software Project Management course. > I was wondering if there is some place where I can find

Re: Django Development Model

2012-10-28 Thread Lachlan Musicman
On Mon, Oct 29, 2012 at 2:00 PM, Lachlan Musicman <data...@gmail.com> wrote: > On Mon, Oct 29, 2012 at 9:39 AM, Smriti Patodi <smritipat...@gmail.com> wrote: >> I was wondering if there is some place where I can find documentation >> related to Django's Softwar

Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
Hi, I'm struggling to get the syntax right for a url reverse function. I have a form that asks for a Model type (ChoiceField with strings) and a year (CharField). The logic then if/elifs the ChoiceField and then redirects to the appropriate report page (for statistics on the Model type), with

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
gt; > On 10/29/2012 4:11 PM, Lachlan Musicman wrote: >> Hi, >> >> I'm struggling to get the syntax right for a url reverse function. >> >> I have a form that asks for a Model type (ChoiceField with strings) >> and a year (CharField). >> >> The logic

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
nd functions in some way. Could you please expand on your answer for a beginner? Cheers L. > On Oct 29, 2012, at 4:38 PM, Lachlan Musicman wrote: > >> On Tue, Oct 30, 2012 at 11:14 AM, Nikolas Stevenson-Molnar >> <nik.mol...@consbio.org> wrote: >>> You're close.

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 1:03 PM, Christophe Pettus <x...@thebuild.com> wrote: > > On Oct 29, 2012, at 4:52 PM, Lachlan Musicman wrote: >> Could you please expand on your answer for a beginner? GAH! Thanks. I've been thinking that there's got to be an easier way to get and gene

Joining querysets?

2012-10-29 Thread Lachlan Musicman
Hola, So I've reached the point where I feel it necessary to join querysets. All the ref's I've read online are quite old and recommend using | or itertools.chain() Are these still the recommended method, or am I doing it wrong? cheers L. -- ...we look at the present day through a rear-view

Re: Joining querysets?

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 1:35 PM, Lachlan Musicman <data...@gmail.com> wrote: > Hola, > > So I've reached the point where I feel it necessary to join querysets. Don't bother with this - I just wrote a better Query to solve this issue L. > > All the ref's I've read

Re: Joining querysets?

2012-10-30 Thread Lachlan Musicman
On Wed, Oct 31, 2012 at 1:26 AM, Bill Freeman wrote: >>> >>> All the ref's I've read online are quite old and recommend using | or >>> itertools.chain() >>> >>> Are these still the recommended method, or am I doing it wrong? > > This depends on what you mean by "join" (just in

Re: Help me choose OS for django server

2012-10-30 Thread Lachlan Musicman
On Wed, Oct 31, 2012 at 2:04 PM, Chris Pagnutti wrote: > > @Nik: > Just following the django docs, it recommends Apache+mod_wsgi for the django > app, and either lighttpd or nginx to serve media. I liked the idea of > serving media separately because the app is heavy on

Re: Problem with formset

2012-10-31 Thread Lachlan Musicman
On Thu, Nov 1, 2012 at 7:30 AM, Satinderpal Singh wrote: > I use formset in my views.py file for the forms. It saves the entries from > the form to the database but the problem is that it shows all the previous > forms along with the new form for the new entry. The

Re: Problem with formset

2012-11-01 Thread Lachlan Musicman
On Thu, Nov 1, 2012 at 6:32 PM, Satinderpal Singh < satinder.goray...@gmail.com> wrote: > On Thu, Nov 1, 2012 at 1:25 AM, Lachlan Musicman <data...@gmail.com>wrote: > >> On Thu, Nov 1, 2012 at 7:30 AM, Satinderpal Singh >> <satinder.goray...@gmail.com> wrot

Re: Problem with formset

2012-11-04 Thread Lachlan Musicman
, Nov 2, 2012 at 1:41 AM, Lachlan Musicman <data...@gmail.com>wrote: > >> On Thu, Nov 1, 2012 at 6:32 PM, Satinderpal Singh < >> satinder.goray...@gmail.com> wrote: >> >>> On Thu, Nov 1, 2012 at 1:25 AM, Lachlan Musicman <data...@gmail.com>

Re: initializing virtualenvwrapper on Mac (10.6.8) for Django

2012-11-05 Thread Lachlan Musicman
WORKON_HOME is a shell variable, which is why it's then called/accessed using the $ - $WORKON_HOME Export tells the shell to put it in it's local vars for the session, and to set the var to ~/Export the mkdir -p will create the directory ~/Envs (or whatever you chose to set WORKON_HOME to). It

Re: initializing virtualenvwrapper on Mac (10.6.8) for Django

2012-11-05 Thread Lachlan Musicman
I should add that you can see what any shell VAR is set to by using echo $VAR or see what they are all set to by using printenv And that by shell I'm generically referring to all shells: sh, csh, ksh, bash, dash, ash. Cheers L. On Tue, Nov 6, 2012 at 2:10 PM, Lachlan Musicman <d

  1   2   3   4   5   >