"python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-07 Thread George
Hi- I'm pretty sure this shouldn't happen; but the error is no doubt my fault. Maybe something about the doc doesn't apply to my system? I have pkgsrc python2.5 and Django 1.0.2 # python2.5 manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in execute_manager(s

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
Hi Karen, On Apr 8, 2:33 am, Karen Tracey wrote: > On Tue, Apr 7, 2009 at 8:39 PM, George wrote: > > > I'm pretty sure this shouldn't happen; but the error is no doubt my > > fault. Maybe something about the doc doesn't apply to my system? I > > have pkg

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
There is an explanation below, having to do with management dependencies and dates the versions and packages became available. But for the record, the solution is to install the py-sqlite3 package in addition to py-djangoi (with sqlite enabled). --George On Sat 11 Apr 2009 at 08:25:04 PM +0200

mod_python can't find settings

2007-08-10 Thread george
I have seen previous posts regarding this issue, and I'm pretty sure that I'm not running into similar issues that others have faced. I'm a bit stuck as to where to go. I'm running Apache2, python2.3, mod_python, latest django and CentOS 4.5. I've got a django project

Re: mod_python can't find settings

2007-08-10 Thread george
Malcom -- Thanks for the quick reply. I believe the files are set correctly: ls -l /home/george/testing yields: drwxrwxr-x 6 george george 4096 Aug 10 19:14 myapp drwxrwxr-x 2 george george 4096 Aug 10 17:13 document_root drwxrwxr-x 3 george george 4096 Aug 10 17:14 templates and ls -l

Re: mod_python can't find settings

2007-08-10 Thread george
Oh and sorry I meant "Malcolm" that second "l" is a killer... On Aug 10, 11:48 pm, george <[EMAIL PROTECTED]> wrote: > Malcom -- Thanks for the quick reply. > > I believe the files are set correctly: > > ls -l /home/george/testing yields: > drwxrwx

Re: mod_python can't find settings

2007-08-11 Thread george
So it turns out that lack of sleep was causing me to be an idiot. Malcolm, your initial instinct was correct -- while the app directory and files all had the correct permissions, the /home/george directory lacked the necessary o+x for apache. In the end I apologize for asking a question about a

Re: Missing datepicker in Django 1.3 admin

2011-08-20 Thread George
Thanks Kenneth I commented that out .. I'm still not seeing the datepicker icons in admin! On Aug 20, 2:51 pm, kenneth gonsalves wrote: > On Sat, 2011-08-20 at 01:53 -0700, George wrote: > > ADMIN_MEDIA_PREFIX = '/static/admin/' > > this does not exist in

Re: Missing datepicker in Django 1.3 admin

2011-08-20 Thread George
for static files. it might help you figure out what is > going on. > > 2011/8/20 George > > > > > > > > > Thanks Kenneth > > > I commented that out .. I'm still not seeing the datepicker icons in > > admin! > > > On Aug 2

Re: Which IDE should I use for Django?

2011-12-19 Thread george
emacs +1 On Dec 19, 3:42 pm, Masklinn wrote: > On 2011-12-19, at 16:30 , Andre Terra wrote: > > > > > What do you mean by embedded Django interpreter? An instance of python > > running within Aptana? > > Django performs a bunch of setup which allow for easy import and manipulation > of the objec

multiple comment forms

2011-03-05 Thread george
Hi I have multiple comment forms on a single page (aggregated blog entries). The page does not validate due to duplicate ids in the form. Anyone know of a solution to this? Cheers! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: multiple comment forms

2011-03-05 Thread george
yes, I saw this and hacked the get_form function of CommentFormNode to see if it would work, but the form fails with "Missing content_type or object_pk field." On Mar 5, 4:47 pm, Karen Tracey wrote: > On Sat, Mar 5, 2011 at 8:09 AM, george wrote: > > I have multiple commen

Re: wsgi configuration

2011-03-31 Thread george
the path should be: path='/home/yongzhen/workspace/www' for iStore.settings to resolve On Mar 31, 1:40 pm, yongzhen zhang <4...@live.cn> wrote: > Hi, > I am using apache + wsgi for my Django project. But now i am a bit > confused. The project is under /home/yongzhen/workspace/www . I put > the a

Re: Using primary key to update via POST request.

2020-07-20 Thread George
You use request.GET['choice_filed'] On Monday, July 20, 2020 at 9:14:48 AM UTC+5:30, Arpana Mehta wrote: > > Hi, > I have a class with a GET and a POST request. I am sending the data ( with > pk of the object ) in my GET request and I want the frontend to use that pk > to refer to the exact inst

Re: My first question

2020-07-20 Thread George
Consider reading this article on how to read csv files in Python . On Saturday, July 18, 2020 at 11:55:57 AM UTC+5:30, Sead Sejo Gicić wrote: > > What is the difference between ordinary txt file and csv file for using in > Python

How to access siblings of a page in an efficient manner.

2020-07-20 Thread George
I am using using Django to create custom CMS, where pages are stored in a hierarchy (implemented using django-mptt). On a given child page, I want to show the links to all its siblings. Currently, I am doing this with the help of a template tag which looks like this: @register.inclusion_tag(

Table inheritance and polymorphic admin forms

2008-12-21 Thread George Sakkis
re a workaround ? George --~--~-~--~~~---~--~~ 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 this group, send email

Re: Table inheritance and polymorphic admin forms

2008-12-22 Thread George Sakkis
On Dec 21, 10:02 pm, Malcolm Tredinnick wrote: > On Sun, 2008-12-21 at 18:50 -0800, George Sakkis wrote: > > Hi all, > > > I have a situation which I think would best be modeled as (single) > > inheritance, involving product reviews for various kinds of products. >

Re: Table inheritance and polymorphic admin forms

2008-12-22 Thread George Sakkis
On Dec 22, 7:04 pm, Malcolm Tredinnick wrote: > On Mon, 2008-12-22 at 09:42 -0800, George Sakkis wrote: > > [...] > > > > > Unfortunately it doesn't work for what I tried. What I am trying to do > > is have the Child classes as InlineModelAdmin in some o

sys.path trickery in settings.py

2009-01-04 Thread George Cox
Hi, I keep my django-trunk installation (and other things like django_evolution) in my home directory, outside the system-wide installation To avoid having to set PYTHONPATH in the environment, I set do this in my project settings.py file: # sys.path trickery -

Customize form fields after instantiation

2009-01-24 Thread George Sakkis
there a better way to do it ? If not, I think it might be useful enough to be added in the base ModelForm. George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

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

middleware response processing always occurs

2009-01-29 Thread George Lund
allows the request to proceed or not. But I guess such a change could break existing code, so at the very least the docs could use a bit more explanation and or highlighting in bold! thanks George Lund --~--~-~--~~~---~--~~ You received this message because you

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

Redundant select on QuerySet delete/update

2009-02-05 Thread George Sakkis
ids) print connection.queries # shows no queries qs.delete() print connection.queries # shows two queries, a select followed by a delete Am I missing something or Is this supposed to work like this, and if so why ? George --~--~-~--~~~---~--~~ You received this message becau

Re: Redundant select on QuerySet delete/update

2009-02-05 Thread George Sakkis
On Feb 5, 3:13 pm, Alex Gaynor wrote: > On Thu, Feb 5, 2009 at 3:09 PM, George Sakkis wrote: > > > > > > > Hello, > > > I am looking at the raw sql executed when I run a delete or update on > > a QuerySet and it appears that it does a redundant "sele

Customize the InlineModelAdmin forms conditionally

2009-02-06 Thread George Sakkis
there another way to do it without replacing the admin template ? George --~--~-~--~~~---~--~~ 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@goog

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

traceback - no local variables

2009-03-10 Thread George Lund
thing else. Does anyone know how to make Django supply all the variables in the email? TIA George Lund --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: traceback - no local variables

2009-03-12 Thread George Lund
13 am, Thomas Guettler wrote: > Hi, > > I attached a HandleExceptionMiddleware I use. You need to modify it > to your needs. It attaches the html page of cgitb and the django > debug page to the email. > >   Thomas > > George Lund schrieb: > ... > > Does anyo

Re: Comparing BoundField values in templates

2009-03-12 Thread George Song
I think the easier way is just to write a custom widget which subclasses RadioSelect and override the render() method to however you want to output the HTML. On Jan 19, 6:45 am, ekellner wrote: > Hi, I am having trouble working with a BoundField value in a template. > > What I have is a Interger

FK problem: can it point to an object which hasn't been saved yet?

2009-08-10 Thread George Laskowsky
quot;father" appears empty. Thanks -- George Laskowsky Ziguilinsky --~--~-~--~~~---~--~~ 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

Easy question

2009-08-13 Thread George Laskowsky
Hi, I was wondering about forms (and modelforms), what is the difference between passing it an object (in the 'instance' attribute) and passing it an dictionary with the same data (in the 'initial' attribute)? Thanks -- George L

ModelForm's is_valid() returns False, but I don't know why.

2009-08-14 Thread George Laskowsky
e] The webpage shows the form populated with the data, BUT, is_valid() always return false. I don't know what fails to validate, form.errors is empty. Thanks! P.S: thanks Margie for the last help. -- George Laskowsky Ziguilinsky --~--~-~--~~~---~--~~ You re

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)

Django Test Coverage

2009-04-30 Thread George Song
I've decided to release the test coverage app I've been using on my projects as open source. I've packaged it as a third-party Django app for convenience. But the underlying components can be used independently from Django as well. <https://www.ohloh.net/p/django-test-cov

Re: Tables with same schema

2009-05-01 Thread George Song
Plain ol' Python multiple inheritance should work. Just define the fields you want in some class: {{{ class PersonMixin(object): first = models.CharField(max_length=16) last = models.CharField(max_length=16) class Person(models.Model, PersonMixin): pass class Person2(models.Model, Pe

Re: Validation error when uploading jpeg via admin

2009-05-01 Thread George Song
; > "Upload a valid image. The file you uploaded was either not an image > or a corrupted image." > > Can anyone provide some help? This is driving me crazy. Thanks! Are you able to successfully operate on *that* file using PIL directly

Re: Create a web service for an existing stand alone python script

2009-05-01 Thread George Song
On 5/1/2009 5:13 AM, pallavi wrote: > For example lets say my python script is named "science.py" and it > reads two input files for the input data : abc.txt and xyz.txt and > after computation the output file is : output.txt If abc.txt and xyz.txt are available somehow directly on the applicati

Re: Validation error when uploading jpeg via admin

2009-05-01 Thread George Song
Can you try the same operation using the Django development server and see what happens? On 5/1/2009 7:19 AM, Jason Sypolt wrote: > Also, I'm going through wsgi and not mod_python. Not sure if that > makes a difference.. > > > On May 1, 10:12 am, George Song wrote: &g

Re: save_formset() in admin.TabularInline doesn't work.

2009-05-01 Thread George Song
in Panel the method in AAdmin aren't called. > > Where is the problem? The problem is you're not telling us what it is you're trying to achieve. It's hard to debug code without knowing what you're tying to do, other than to say what you already know -- this

Re: Displaying rows as columns

2009-05-01 Thread George Song
, but is a general data pivot problem. So my advice would be to search for a solution that fits your need. It doesn't matter what the language/framework the solution is in, it's the general pattern you're after. A hint: I personally would avoid trying to do this in SQL, if nothing

Re: Displaying rows as columns

2009-05-02 Thread George Song
ault('by_day', [0]*len(date_header)) i = date_header[datetime.date(t.start)] by_day[i] += t.duration info['total'] = info.get('total', 0) + t.duration }}} Pass `entries` and `schedule` as context vars to your template, and you can iterate through your sc

Re: getting no such table error

2009-05-02 Thread George Song
On 5/2/2009 6:02 AM, tekion wrote: > Exception Type: OperationalError at /play_django/page/start/save/ > Exception Value: no such table: mywiki_page_tags Did you log into SQLite and see if that table exists? -- George --~--~-~--~~~---~--~~ You receive

Re: Accessing related object data in template

2009-05-02 Thread George Song
lates I use > > {{ car|car_tag_get:"colour" }} > > This works fine but is there an easier or more practical way? <http://docs.python.org/reference/datamodel.html#object.__getattr__> on your Car model is perhaps the way to go. -- George --~--~-~--~~---

Re: Displaying rows as columns

2009-05-02 Thread George Song
On 5/2/2009 7:40 AM, George Song wrote: > Pass `entries` and `schedule` as context vars to your template, and > you can iterate through your schedule using ordered list of entries. There's also `django.utils.datastructures.SortedDict` so you can bypass the `entries` business and sa

Re: getting no such table error

2009-05-02 Thread George Song
> away the db and re-run it. Is it possible you made model changes after the first time you ran syncdb? -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Debug middleware

2009-05-02 Thread George Song
r, "" > > to your heart's content. Or you can always use `pdb` if you're running the development server. -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Create a web service for an existing stand alone python script

2009-05-02 Thread George Song
r your > help. > Thank you. Best regards -Pallavi Hi Pallavi, I don't have the time or the inclination to teach you Python. You should learn that on your own. There are excellent resources on the web to help you with that. Also you

Re: print_r() in Django & SQL debug output

2009-05-02 Thread George Song
On 5/2/2009 4:53 PM, Okto Silaban wrote: > Ok, I know this is not a PHP mailing list.. I just want to make the > question simpler. > > I'm coming from CakePHP background. > > 1. What Django template tags can I use to replace print_r() / var_dump() > in PHP? > 2. How can I display SQL debug out

Re: Altering database object

2009-05-02 Thread George Song
method on your Score model: {{{ class Score(models.Model): def date_fr_moment(self): return DateFr(self.moment) }}} In your template, you can just access it with s.date_fr_moment. -- George --~--~-~--~~~---~--~~ You received this message because

Re: problem rendering html images in browser

2009-05-03 Thread George Song
correct. If I open the html template > file with my browser, it does render the image, but in a view, it does > not. It would be helpful if you can dpaste your view/template code, as well as the rendered HTML. -- George --~--~-~--~~~---~--~~ You rece

Re: ManyToMany with a "through" attribute in the admin profile

2009-05-03 Thread George Song
bases. From within that Route object (r), > is there anyway to get access to the RouteBase attributes? Something > like r.sequence? The intermediate class is no different than any other many-to-one related classes: <http://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects>

Re: Os.path in window and linux help?

2009-05-03 Thread George Song
nyone have an experience with os.path to work cross platforms Please > help me to resolve this problem. Why aren't you just using settings.MEDIA_URL? Does xhmtl2pdf need a file URI? If so, you should take a look at urllib.pathname2url. -- George --~--~-~--~~~--

Re: How to handle view/url situation (Newbie)

2009-05-03 Thread George Song
#views.py > > def showItems(request): > # get the items from the model > return render_to_response('lists/show.html', {'items':items}) > > def deleteItems(request, item): > # delete the item > return render_to_response('l

Re: Anyone else having issues with filter_horizontal in trunk?

2009-05-04 Thread George Song
gt; >> Anyone else seeing the same issue? I just tested it in my app and it's fine. -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send em

Re: data too long in a CharField column

2009-05-04 Thread George Song
> chars, then it will validate it and > truncate excessive chars before saving. But it doesn't. How can I get > rid of that problem? If you want that behavior, just truncate `myfield` in `MyModel.save()` before calling the super save. <htt

Re: form elements css changes on errors

2009-05-04 Thread George Song
didn't validate, something like this should work: {{{ for field_name in form.errors: form.fields[field_name].widget.attrs['class'] = 'error' }}} Then just output your form again. -- George --~--~-~--~~~---~--~~ You received th

Re: ManyToMany with a "through" attribute in the admin profile

2009-05-05 Thread George Song
On 5/4/2009 6:36 PM, nbv4 wrote: > > > On May 4, 12:03 am, George Song wrote: >> On 5/3/2009 8:17 PM, nbv4 wrote: >> >> >> >>> On May 3, 3:51 pm, Ramiro Morales wrote: >>>> On Sun, May 3, 2009 at 4:26 PM, nbv4 wrote: >>>>>

Re: "Lookups that span relationships" + objects.exclude()

2009-05-05 Thread George Song
= Employee.objects.filter( qualification__type__exact='A1').values_list('pk', flat=True) what_you_want = Employee.objects.exclude(pk__in=excludes) }}} or {{{ all = Employee.objects.all() excludes = Employee.objects.filter(qualification__type__exact='A1') what_yo

Re: Create a web service for an existing stand alone python script

2009-05-05 Thread George Song
're on the right track. 1. You can't name both views the same, if they're in the same module. Otherwise the second definition will override the first one. 2. There's a slight mistake in your response: {{{ def science_service(request): return HttpResponse(

Re: "Lookups that span relationships" + objects.exclude()

2009-05-05 Thread George Song
our original exclude filter. See: <http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships> -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: TIME_ZONE problem

2009-05-05 Thread George Song
t; > SetHandler python-program > PythonPath "['/path-to-my-project/'] + sys.path" > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE portal.settings > PythonDebug Off > > > Does someone fa

Re: restrict choice of recursive many to many relation

2009-05-05 Thread George Song
nk=True, > symmetrical=False, related_name='original_entries') ModelAdmin has a `formfield_for_dbfield` hook. You can probably do something clever with that. -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: restrict choice of recursive many to many relation

2009-05-05 Thread George Song
nk=True, > symmetrical=False, related_name='original_entries') There's also `limit_choices_to` param: <http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.limit_choices_to> -- George --~--~-~--~~~---~--~~ You rec

Re: Can not get Django admin page

2009-05-05 Thread George Song
lines below the > “Uncomment the next two lines...” > > Can anybody tell me what I should do to fix this? > > Thanks so much. What URL are you accessing? If you're using the local development server you should be hitting http://localhost:8000/admin/. -- George --~--~

Re: Django custom ManyToManyField widget

2009-05-06 Thread George Song
an i do this? I am using django > 1.02. Plz help me. Usability issues aside, you can easily achieve this by writing your own custom widget. You can subclass from the `SelectMultiple` widget and override the `render()` and `value_from_datadict()` methods. Good lu

Re: Getting to the 'latest' item in a template list

2009-05-06 Thread George Song
the way, `filter(product_id__product_id=product_id)` looks funny to me. Are you sure you don't want just `filter(product__pk=product_id)`? -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: TIME_ZONE problem

2009-05-06 Thread George Song
On 5/6/2009 4:02 AM, Graham Dumpleton wrote: > > > On May 6, 4:38 am, George Song wrote: >> On 5/5/2009 6:48 AM, Michel Thadeu Sabchuk wrote: >> >> >> >>> Hi guys, >>> I'm having a weird problem with TIME_ZONE settings. Some view list &g

Re: Help with some models inheritance and the use of default

2009-05-06 Thread George Song
= ?? > > How can I set language of the to the language of its country's > language by default? I think the easiest thing is to put the logic in your `City.save()` method, since you'll have access to the instance's country at that point. Then it's just a matter of loo

Re: Django and a basic SQL join

2009-05-06 Thread George Song
.. > > e = FlattenedCategory.objects.select_related('category').filter > (member_of_category=15) > > which works... This, however, doesn't > > e = e.category > > How do I access the related records from the Category mod

Re: Django and a basic SQL join

2009-05-06 Thread George Song
In your case e is a QuerySet, with multiple FlattenedCategory objects. So the proper code would be to loop through them: {{{ for fc in e: fc.category_set }}} On 5/6/2009 10:17 AM, jrs_66 wrote: > No... 'QuerySet' object has no > attribute 'category_set' > &

Re: aggregate formatting

2009-05-06 Thread George Song
2? > > I know this is likely a simply python question, but not sure what that > returned format is called in order to search accordingly for an > answer. The object being returned back by aggregate is a Python dictionary. In this case, you just want the value of the 'checkque_

Re: Run context processor conditionally?

2009-05-06 Thread George Song
the context processor only for views defined in that > app's URL conf or something? You can specify extra context processors to use with RequestContext in your view: <http://docs.djangoproject.com/en/dev/ref/templates/api/#id1> -- George --~--~-~--~~~-

Re: Custom function to serve a static file with Django...

2009-05-06 Thread George Song
the downloading of the file). > > What is the best way to accomplish this? Just return the content of the file in a standard HttpResponse object, and make sure you set the right mimetype and any other header you want, and that should be it. -- George --~--~-~--~~~-

Re: Run context processor conditionally?

2009-05-06 Thread George Song
ted from every view for > which one wants to use the context processor anyway, huh? > > I always feel like I'm repeating myself when passing global context to > every single template. > > On May 6, 5:13 pm, George Song wrote: >> On 5/6/2009 1:37 PM, ringemup wrote: &g

Re: running filters on db objects in template?

2009-05-06 Thread George Song
filters, you can definitely perform some comparisons in the template itself for each b record based on some b.value. For flexibility and power, you probably want to do it in the view, though. You don't have access to any QuerySet API that requires

Re: Problem with overriding save() method

2009-05-06 Thread George Song
have a suggestion. > > Thanks in advance. I'm not sure why you're getting yoga-for-kids_2, what I expect is yoga-for-kids, yoga-for-kids_1, then more yoga-for-kids_1 if your slug field is not unique=True. In any case, your logic will keep generating yoga-for-kids_1 because there

Re: Problem with overriding save() method

2009-05-06 Thread George Song
On 5/6/2009 11:18 PM, Lee Hinde wrote: > On Wed, May 6, 2009 at 11:15 PM, Lee Hinde wrote: >> On Wed, May 6, 2009 at 10:54 PM, George Song wrote: >>> On 5/6/2009 10:34 PM, Lee Hinde wrote: >>>> On Wed, May 6, 2009 at 10:22 PM, George Song wrote: >>>

Re: Problem with overriding save() method

2009-05-06 Thread George Song
On 5/6/2009 10:34 PM, Lee Hinde wrote: > On Wed, May 6, 2009 at 10:22 PM, George Song wrote: >> On 5/6/2009 9:57 PM, Lee Hinde wrote: >>> I have this as part of the model for a class called "Class" >>> >>> >>> def save(self, for

Re: Ajax and non-ajax forms.

2009-05-07 Thread George Song
read w/o relying on styling if possible, if you want things like screen readers to work. -- George --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ManyToMany relationships in an object creation view

2009-05-07 Thread George Song
PPINGS_CHOICES, widget=forms.CheckboxSelectMultiple) class Meta: model = Pizza >>> from m2m.models import PizzaForm >>> f = PizzaForm() >>> print f['toppings'] Pesto Garlic }}} -- George --~--~-~--~~~---~--~~ You

Re: Need help optimizing a view, too many queries

2009-05-07 Thread George Song
er,provider__provider_partners=request.partner)) > p.call_count = p.call_records.filter().count() > return PartnerResponse(request, {'profiles': profiles}) > > PartnerResponse returns the view to the user, the template uses a for > loop to iterate through the profiles.

Re: Aggregated Expression.

2009-05-07 Thread George Song
be a fancy way to do this in QuerySet, but I don't know how. I personally would just write a custom method on Customer or Order to do this for you, depending on what level of aggregation you need. -- George --~--~-~--~~~---~--~~ You received this message because you a

Re: Need help optimizing a view, too many queries

2009-05-07 Thread George Song
On 5/7/2009 11:16 AM, Eric Chamberlain wrote: > > On May 7, 2009, at 10:36 AM, George Song wrote: > >> On 5/7/2009 8:56 AM, Eric Chamberlain wrote: >>> Our view is taking too long to render, can anyone offer suggestions >>> to >>> improve

Re: Trouble Starting Up with runserver

2009-05-07 Thread George Song
ot;. The subject at hand is an > address, not a protocol, yet what was written is "public IP" not > "public IP address". This is fine for casual conversation, but -- > for reasons including that which was discovered in this discussion > -- not for a

Re: Wrapping object_detail generic view in another view

2009-05-07 Thread George Song
er, after all. I don't see much value in this specific instance, unless you think the meaning of "get_by_author" may change at some point. p.s. Use spaces instead of tabs in your code. It was extremely hard to read. -- George --~--~-~--~~~---~--~

Re: Problem with overriding save() method

2009-05-07 Thread George Song
On 5/7/2009 8:05 AM, Lee Hinde wrote: > On Wed, May 6, 2009 at 11:37 PM, George Song wrote: >> On 5/6/2009 11:18 PM, Lee Hinde wrote: >>> On Wed, May 6, 2009 at 11:15 PM, Lee Hinde wrote: >>>> On Wed, May 6, 2009 at 10:54 PM, George Song wrote: >>>&

Re: TIME_ZONE problem

2009-05-07 Thread George Song
On 5/7/2009 5:00 PM, Graham Dumpleton wrote: > > > On May 7, 2:41 am, George Song wrote: >> On 5/6/2009 4:02 AM, Graham Dumpleton wrote: >> >> >> >> >> >>> On May 6, 4:38 am, George Song wrote: >>>> On 5/5/2009 6:48 AM, Mi

Re: limiting choices for foreign key choices in the admin view

2009-05-07 Thread George Song
is a way of overriding an internal method, that seems preferable to > me. I'll point you in the right direction: `django.contrib.admin.options`. Look specifically at `formfield_for_dbfield()` and the various flavors of related "hooks." I'll bet you can figure out what to

  1   2   3   4   >