Re: Automagical Invoice Generation

2009-01-26 Thread Almost George
On Jan 26, 10:52 am, Alfonso wrote: > I've got a very simple customer order model that saves the usual > details into the system on a successful order placement.  I'm trying > to think of a way I can generate an associative invoice at the same > time an order is submitted?  Something within a c

Events models - Concert/Single -vs- Tour/Festival

2009-01-26 Thread Almost George
Looking for some advice from anyone who's done something similar... I'm working on a niche concert/event site, that essentially lists upcoming events sorted by Date/City/Venue, etc. Initially, my Event model (primarily) consisted of a Name and a Date (start/end), Bands (m2m), and a FK to a Venu

Re: trouble with yesno to generate images

2009-01-26 Thread Almost George
On Jan 26, 3:39 pm, Margie wrote: > Hi, > > I am trying to generate a symbol for true and false in my table, but > am having problems with the escaping of quotes and also with > generating the < > tags.  If I use the code below: >        {{ task.done|yesno:" \" />," }} > > it ends up generating

Re: trouble with yesno to generate images

2009-01-26 Thread Almost George
On Jan 26, 3:58 pm, Almost George wrote: > On Jan 26, 3:39 pm, Margie wrote: > > > > > Hi, > > > I am trying to generate a symbol for true and false in my table, but > > am having problems with the escaping of quotes and also with > > generating

Re: trouble with yesno to generate images

2009-01-27 Thread Almost George
On Jan 26, 4:52 pm, Margie wrote: > Thanks very much, autoescape did the trick, here is the result for > anyone interested: > >         {% autoescape off %} >         {{ task.done|yesno:" \" alt=\"False\" />, \"False\" />" }} >         {% endautoescape %} > > Margie Margie, Thanks for being

Adjusting these models for other functionality

2009-01-27 Thread Almost George
-- MODELS -- ( Other, unimportant fields/models have been removed ) class Band(models.Model): name= models.CharField(max_length = 50, unique = True) class Venue(models.Model): name= models.CharField(max_length = 50) class Event(mod

Re: Adjusting these models for other functionality

2009-01-28 Thread Almost George
On Jan 27, 9:56 pm, Malcolm Tredinnick wrote: > On Tue, 2009-01-27 at 09:57 -0800,AlmostGeorgewrote: > > -- MODELS -- ( Other, unimportant fields/models have been removed ) > > >    class Band(models.Model): > >            name    = models.CharField(max_length = 50, unique = True) > > >    clas

Re: Can I control contents of SELECT in queryset?

2009-01-29 Thread Almost George
On Jan 29, 8:44 am, phoebebright wrote: > I want a distinct list of all the 'cat__names' that exist in > Subcategory and have at least one entry in Business (Business is a > subclass of model Directory which might be the problem) > > dir_query = Business.objects.all().select_related().distinct(

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Almost George
On Jan 30, 6:09 am, min wrote: > Thanks a lot. > > Besides, what's the meaning for the 'escape_js' in [var x = > "{{ variable|escape_js }}"] ? > > Regards > Min > > On Jan 30, 4:33 pm, Malcolm Tredinnick > wrote: > > > On Thu, 2009-01-29 at 21:11 -0800, min wrote: > > > Hi. > > > > First, the

Question about Filtering on a Related model (I think) - with example code.

2009-02-09 Thread Almost George
On the following example models (actual models, removed of cruft that doesn't seem to apply) I'd like to add a "get_upcoming_events" method to Band like the one on Venue, but because of the relationship I'm not sure how to use the API/filter. (An Event has the same bands, at possibly different occ

Re: Question about Filtering on a Related model (I think) - with example code.

2009-02-10 Thread Almost George
On Feb 10, 1:30 am, Daniel Roseman wrote: > On Feb 10, 5:03 am, Almost George > wrote: > > > > > On the following example models (actual models, removed of cruft that > > doesn't seem to apply) I'd like to add a "get_upcoming_events" method > &

Re: Question about Filtering on a Related model (I think) - with example code.

2009-02-10 Thread Almost George
On Feb 10, 8:25 am, Almost George wrote: > On Feb 10, 1:30 am, Daniel Roseman > wrote: > > > > > On Feb 10, 5:03 am, Almost George > > wrote: > > > > On the following example models (actual models, removed of cruft that > > > doesn't

Re: WYSIWYG Image upload challenge

2009-02-18 Thread Almost George
On Feb 18, 5:36 am, phoebebright wrote: > There is something different about the way django is handling to response to > php I think. I use the YUI Rich Editor in admin, and have no problems. I know debugging isn't as easy in IE as others, but do your best to find out the exact response (mos

From example models, how to highlight relation in Template

2009-04-25 Thread Almost George
I have (essentially) the following models: class AttendanceRelation(models.Model): event = models.ForeignKey('swingtime.Occurrence') attendee = models.ForeignKey('AttendeePerson') class AttendeePerson(models.Model): first_name= models.CharField(blank=False, max_length=100)

Using 'django-filter' on a field with choices

2009-09-21 Thread Almost George
I'm using the very cool django-filter (via: http://github.com/alex/django-filter) and either can't seem to wrap my head around the docs, or maybe just need a little boost. When I show the filter form on an object list page, for a FK field I get the dropdown that includes a "-" which kind of

Re: Using 'django-filter' on a field with choices

2009-09-21 Thread Almost George
On Sep 21, 8:54 am, Almost George wrote: > I'm using the very cool django-filter > (via:http://github.com/alex/django-filter) > and either can't seem to wrap my head around the docs, or maybe just > need a little boost. > > When I show the filter form on an object

Merge models?

2009-09-22 Thread Almost George
Wondering if there is already work being/been done on making it easy to merge models. It may be much easier than I think, but I thought I would ask anyway. Here's my specific scenario: On a site where users contribute a good deal of content, someone might come across a piece of content that coul

Complicated Form "Workflow" - Need ideas/direction

2009-12-14 Thread Almost George
I have a working site, and the admin works fine for what I'm doing. I have 3 primary models: an Event, an Attendee, and a Venue. In the admin, an Event created *must* have at least one Attendee, and must, obviously, have a Venue (location). I'd like to open up the site for user submissions (users

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-14 Thread Almost George
On Dec 14, 2:23 pm, Shawn Milochik wrote: > What you're trying to do is simple enough to write out in flowchart form on a > sheet of paper. You should do that, then write some code, then ask for help > with specifics when you get stuck, or are trying to decide between different > approaches.

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-14 Thread Almost George
On Dec 14, 3:04 pm, Shawn Milochik wrote: > Okay, here are a few ideas: > > 1. If you hate pop-ups, but aren't opposed to a little AJAX, then you could > do it that way. > > 2. You could do it with a multi-screen, 'wizard-like' set of templates. > > 3. You can keep state using session variables

Notification of Model Changes

2010-08-24 Thread Almost George
This is probably a very old question, but I wasn't able to find an obvious answer - sorry if I overlooked anything. I have a model with a "status" field (using Choices) that defaults to "pending" and has other options like "closed", "active", etc. I would like to implement email notifications of

Re: Notification of Model Changes

2010-08-24 Thread Almost George
On Aug 24, 2:15 pm, Shawn Milochik wrote: > If you override __init__() and store the value of that field in a > temporary value, such as self.old_status, then the instance will have > both self.status and self.old_status for comparison later. > > I hope this fits your use-case. > > Shawn Sounds