Re: Static file serve with prior authentication?

2009-02-23 Thread Andy Mckay
for Apache there is an Authentication handler for mod_python that allows you to authenticate a request for a static file. http://docs.djangoproject.com/en/dev/howto/apache-auth/ Other webservers and tools may vary. -- Andy McKay ClearWind Consulting: www.clearwind.ca Blog: www.agmweb

Re: Is safe unsafe?

2009-02-23 Thread Andy Mckay
On 23-Feb-09, at 2:04 PM, Michael Repucci wrote: > Obviously the latter would > be safer, but there's worth in having the added flexibility, provided > I haven't left a huge hole open. What hole is there to leave open? So they upload a .exe, you aren't executing it a

Re: Is safe unsafe?

2009-02-23 Thread Andy Mckay
served. Then you should really be very sure that your web server is not going to be executing files and will just be serving them. Once you are confident of that, problem removed. -- Andy McKay ClearWind Consulting: www.clearwind.ca Blog: www.ag

Combining Model Forms

2009-03-05 Thread Andy Wilson
ply that data to the two model instances OneTwoForm.update_instances(c1,c2) note that all this assumes that the field names are unique to the two objects. eg. if both modelOne and modelTwo has fields 'info', then this approach wouldn't work, as the same HTML form field value wou

Re: How can i access UserProfile from User in the views?

2009-03-17 Thread Andy Mckay
ess Not sure why you'd be using myprofile there where in python you used get_profile. -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitter.com/clearwind --~--~-~--~~~---~--~~ You received this mess

Re: How can i access UserProfile from User in the views?

2009-03-17 Thread Andy Mckay
request context then you will get the user available: http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#django-core-context-processors-auth -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitt

Re: including text files with django tags?

2009-03-17 Thread Andy Mckay
On 17-Mar-09, at 7:48 PM, codingJoe wrote: > > > > > I have a text file that I want the user to see in a scrolling text > area? I would recommend reading through the django tutorial on the website, since it shows that this is done in python in views and not in a te

Re: Need two response statements on same def

2009-03-18 Thread Andy Mckay
to def Bypub, but I'm not sure how to write > the statements to combine two responses. You can only send one response to a request, so it can be either HTML or a CSV. -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: t

Re: Signals, sites and instances

2009-03-19 Thread Andy Mckay
s a few different ones)? -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitter.com/clearwind --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: Need two response statements on same def

2009-03-19 Thread Andy Mckay
ve to remember to make the change in the other > view. A view is just a Python function, you can do whatever you'd normally do to refactor Python to refactor views. So move the 87 lines of duplicated code into another function and re-use. -- Andy McKay Clearwind Consul

Re: Map events in space on a django app

2009-03-19 Thread Andy Mckay
ure Javascript to place the pin on a map. You can see javascript I used for my site on http://www.cleartrain.ca, if you really want to see the code behind the scenes, I can share some with you in private. -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/a

Re: Django versioning and backup best practice

2009-03-20 Thread Andy Mckay
long with code is quite a fragile way to go. -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitter.com/clearwind --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Andy McKay
On 19-Jun-09, at 3:38 PM, db_333 wrote: > File "/Library/Python/2.5/site-packages/django/core/handlers/ > wsgi.py", line 228, in __call__ >self.load_middleware() > File "/Library/Python/2.5/site-packages/django/core/handlers/ > base.py", line 47, in load_middleware >mw_instance = mw_cla

Re: active django battery projects

2009-06-19 Thread Andy McKay
There's also a list of plugins at http://djangozen.com/plugins/ -- Andy McKay www.clearwind.ca On 2009-06-19, at 1:14 PM, notcourage wrote: > > I for one would be interested in replies showcasing django battery > projects underway. As a new django user, I'm stumb

Re: djangoplugables.com is down ?

2009-06-22 Thread Andy McKay
Fortunately there other sites that offer a list of plugins, for example: http://djangozen.com/plugins and http://djapp.org. The former has every plugin from djangoplugables on it. On 22-Jun-09, at 8:25 AM, Dunsun wrote: > > Hi, > > I am not able to access djangoplugables.com. > It has been d

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-21 Thread Andy McKay
anything to do with it, it would be rejected, so don't bother :) -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitter.com/clearwind --~--~-~--~~~---~--~~ You received this message because you are

Re: Slugs, why would you ever need to store one in the database?

2009-07-24 Thread Andy Mikhailenko
Just one more addition to the replies above: there's a number of snippets[1], recipes and packages[2] which introduce purely autogenerated safe (unique and sometimes also non-ascii-friendly) slugs without using admin. Autopopulated slugs, when used in URLs without exposing internal autoincremente

Re: does anyone have document for django-email-confirmation/

2009-07-26 Thread Andy Mikhailenko
There's a sample project[1] in the github repo. [1] http://github.com/jtauber/django-email-confirmation/tree/master/devproject On Jul 25, 6:35 pm, kk wrote: > Hi, > > Is there any tutorial document about how to use this module? --~--~-~--~~~---~--~~ You received

Re: ANN: Django 1.1 released!

2009-07-29 Thread Andy Mikhailenko
Thanks for this excellent software! -- Andy --~--~-~--~~~---~--~~ 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: Success at using "reusable apps"?

2009-08-16 Thread Andy McKay
ut of course I would still have to > modify threadecomments to take the callback arg) Or sounds like you could write a signal in your own code. -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: twitte

Re: From a relative noob

2009-08-22 Thread Andy McKay
so you are passing a string which MS SQL doesn't know how to convert. > Is there a reason why you cannot simply do the following? > > Some.object.filter(id = var1).filter(value = > var2).filter(Cost__gt=var4) -- Andy McKay Clearwind Consulting: www.clearwind.ca

Re: Test server and Https

2009-08-22 Thread Andy McKay
On 22-Aug-09, at 7:50 AM, Vitaly Babiy wrote: > Hey, > I am working on a site that part of it must be behind HTTPS, is > there any I can run this using the test server? The built in django server does not do HTTPS. Use Apache or some other server to serve HTTPS -- A

Re: Duplicating objects, avoid signals

2009-08-25 Thread Andy McKay
gozen.com/blog/turning-off-django-signals -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.ca/blog/andy Twitter: @clearwind --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: interaction of django with paypal

2009-08-30 Thread Andy Shaw
er a key-based download system (i.e., the IPN callback generates a download key valid for 24 hours and emails it to the customer, and the download page requires a valid key). However, this means that the customer wouldn't get an instant download link. [1]

Re: Call a custom python function during each model save

2009-09-02 Thread Andy Mikhailenko
Try signals[1], namely pre_save[2]. I would stick to this way instead of overriding model's save() method. [1] http://docs.djangoproject.com/en/dev/topics/signals/ [2] http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save On Sep 1, 4:21 pm, Harish wrote: > Hi Frie

Re: How to define variables used in every page?

2009-09-02 Thread Andy McKay
Look up template context processors. -- Andy McKay www.clearwind.ca On 2009-09-02, at 7:03 PM, "richardcur...@googlemail.com" wrote: > > Hi, > > I want to use two 'global' variables in all pages. Obviously I don't > want to put the same varia

Re: extending objects.get()

2009-09-03 Thread Andy McKay
On 2009-09-03, at 4:40 PM, dwh wrote: >>>> j = Junk.objects.get(cheese='12345') > > The field cheese isn't part of Junk obviously. You can do anything you want in a custom manager. What cheese is and how possible that is, is up to you. -- A

Re: What happened to djangoplugables.com?

2009-09-03 Thread Andy McKay
On 2009-09-03, at 3:47 PM, Anthony wrote: > It's been down for a while. It's been dead for a while. Fortunately I did spider it many months ago and put it into http://djangozen.com/app. -- Andy McKay Clearwind Consulting: www.clearwind.ca Twitte

Re: Serializing with not just the query data but also some additional columns

2009-09-03 Thread Andy McKay
e value, etc, etc, etc. > > It seems that serialization only really lets you serialize a queryset. It does indeed, you would have to extend the built-in ones with your own serializer. -- Andy McKay Clearwind Consulting: www.clearwind.ca T

Re: Last object of a set?

2009-09-03 Thread Andy McKay
gt; > {{ course.coursepart_set.all.LAST.end_date }} > > kind regards, > > -raymond > > -- Andy McKay Clearwind Consulting: www.clearwind.ca Twitter: @clearwind --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: 'function' object has no attribute 'fields' errror on first access to development server

2009-09-03 Thread Andy McKay
d does not appear in admin. > > > -- Andy McKay Clearwind Consulting: www.clearwind.ca Twitter: @clearwind --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Can I alter a JS file with Django

2009-03-27 Thread Andy Mckay
eJS > > and in views.py I'd gather some stuff and render a file 'jsFile.js' > into which I've stuffed some things using template tags? > > Is that possible? In short yes, that's pretty much how you'd do it. Just make sure to send the correct mime-t

Re: DjangoBook forms

2009-03-30 Thread Andy Mckay
tted an > empty form" it says: > > Can someone tell me how to fix this or mention why it occurs? Line two merely checks for the presence of the field, not its contents so you probably want (untested) if request.GET.get('criteria'): -- Andy McKay Clearwind Co

Re: Script the New App Process

2009-03-30 Thread Andy Mckay
points. Some like rails give you different commands to generate different parts. I think assuming that it has to be just one particular way is wrong. This has been discussed quite a few times before I believe, so maybe do a bit of googling on that first. -- Andy McKay Clearwind Consu

Re: Auto-populate fields in django?

2009-03-30 Thread Andy Mckay
ger / and manipulator > http://www.b-list.org/weblog/2006/nov/02/django-tips-auto-populated-fields/ > , though am wondering if there is another way around !!! > > -- > Hamza > > > > -- Andy McKay Clearwind Consulting: www.clearwind.ca Blog: www.agmweb.

Re: Performance Issue: ForeignKey will touch database again!

2009-04-03 Thread Andy Mikhailenko
Zeal, the issue in its current state seems to be unrelated to Django. By the way, do you really need to display so many objects on one page? Why not try pagination? Regards, Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Search in multiple models

2009-04-03 Thread Andy Mckay
inated. [snip] > > I think this is a fairly common need so... what could I do? Use the content types framework http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/ eg: http://www.agmweb.ca/blog/andy/2195/ -- Andy McKay Clearwind Consulting: www.clearwind.ca Blo

Re: Problem with adding new columns to existing model.

2009-04-06 Thread Andy Mikhailenko
As Daniel suggested, try tools like django_evolution. With the latter you just do: $ ./manage.py evolve --hint -x This shows the changes to be made (--hint) and executes the migration (-x). That's it, the table structure is now synchronized to the Python class without the "alter table" pain. --~

Re: Something is eating memory. How to track it down?

2009-04-08 Thread Andy Baker
uce this. Does that sounds about right? Andy On Wed, Apr 8, 2009 at 1:31 AM, Malcolm Tredinnick wrote: > > On Tue, 2009-04-07 at 15:20 -0700, andybak wrote: > > I've got no really huge tables - the entire db is under 6meg and the > > site isn't even public yet so traff

Admin Inlines astray

2009-04-11 Thread Andy Wilson
pered with', presumably because the admin app knows that it is expecting the form data for the recording model too, so it knows about the inlines. What would stop the inlines appearing in one context when they work fine in the other? tia andy --~--~-~--~~~--

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
ps. I used the 'song' and 'recording' models as an example, in fact I have several apps that use inlines, and on the one installation they are missing in every case. No errors are thrown and I can see nothing relevant in the logs. On Sat, 2009-04-11 at 19:50 +0100, Andy

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
fixed after trying all sorts of approaches I finally got it to work by chmod'ing o+r to the files under the django/contrib/admin directory. Most of them already had read permissions but I could see that a few didn't. a On Sat, 2009-04-11 at 19:58 +0100, Andy Wilson wrote: > p

Fwd: Default ManyToMany ordering

2009-04-12 Thread Andy Lei
mbers are getting found in the wrong order, which messes things up in the field. thanks in advance for your help! -andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: Question about administration

2009-04-12 Thread Andy Lei
http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites is this what you're looking for? On Apr 12, 10:16 am, Karlw wrote: > Hey all, > > I had a general question about administration in Django.  So I do not > think my situation is unique, so I don't want to go out and make a

Re: Fwd: Default ManyToMany ordering

2009-04-13 Thread Andy Lei
hmm, i think that governs how, for example, Persons are ordered in the Person's admin list. what I wanted to do was change the ordering of Persons that show up in the ManyToMany field in the Group admin page. also, is there any general way to affect the default ordering of related items on ManyT

Re: Registration

2009-04-20 Thread Andy Mikhailenko
> How should I go about moving the site onto the django platform? Learn Python, then Django. This implies reading lots of documentation and being really interested in the whole thing. Also, you should try to understand your needs before asking questions about how to address them. Do you need just

Re: Creating sub sections

2009-04-21 Thread Andy Mikhailenko
http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey class Section(Model): ... parent = models.ForeignKey('self') plus some code to build the string representing the path. On Apr 21, 1:30 pm, Oleg Oltar wrote: > Hi! > I am writing an application - a kind of article manage

Re: count the number of times an object / class has been instantiated

2009-04-30 Thread Andy Mikhailenko
Hi, your question does not seem to be related to Django. Anyway: class A: cnt = 0 def __init__(self): A.cnt += 1 If you want to count saved instances of a Django model, use MyModel.objects.count(). Cheers, Andy --~--~-~--~~~---~--~~ You received

Re: Avatars in comments

2009-05-03 Thread Andy Mikhailenko
m/p/django-gravatar/ Regards, Andy --~--~-~--~~~---~--~~ 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 em

Annotations

2009-05-07 Thread Andy Lei
y, it'd be something like Writer.objects.annotate(content_count=Count ("content__tags=tag1")).order_by('content_count") Obviously, that doesn't work. Any help would be greatly appreciated. Thanks! -Andy --~--~-~--~~~---~--~~ Y

Re: Category list in Django

2009-05-11 Thread Andy Mikhailenko
Hi, > in register dispatcher.connect(pre_save, > signal=model_signals.pre_save, sender=modem) > AttributeError: 'module' object has no attribute 'connect' Looks like it's time to update your Django installation. regards, Andy --~--~-~--~~

Re: Annotations

2009-05-11 Thread Andy Lei
works great, thanks george! does anybody know if this is possible to do directly with the ORM? On May 7, 10:41 pm, George Song wrote: > On 5/7/2009 4:28 PM, Andy Lei wrote: > > > > > I have 3 models.  Something like this: > > > Writer: > >      content

Re: A puzzling problem with admin

2009-05-13 Thread Andy Baker
Nothing. It's literally just either: manage.py runserver or manage.py runfcgi The full command is: python ~/myapp/myproject/manage.py runfcgi maxchildren=1 maxspare=1 method=prefork socket=~/myapp/myproject.sock On Wed, May 13, 2009 at 6:14 PM, Brian Neal wrote: > > On May 13, 10:13 am, andyb

Re: What debugger do you use?

2009-05-14 Thread Andy Mikhailenko
I mostly stick to defensive programming so rarely does the need to debug appear; if it does, I use simple print commands to find the stage on which the data is broken; then I fix the algo or add another assert statement. This enables using Kate (or whatever text editor) + manage.py for everything.

Re: Ordering a query by comments connected to model

2009-05-15 Thread Andy Mikhailenko
be great to hear a response from Django developers), I would definitely advise to denormalize your data in this case. Adding an IntegerField and updating it via signals on post_save will simplify and speed up things. cheers, Andy --~--~-~--~~~---~--~~ You received this

Re: Ordering a query by comments connected to model

2009-05-15 Thread Andy Mikhailenko
> I am but what parameter do I give to Count? My entity model don't have > a comments field it is just connected through the view where I do {% > load comments %}? Immediately after posting my comment I understood that you actually can do that easily: Entry.objects.annotate(cc=Count('comment

Re: Ordering a query by comments connected to model

2009-05-16 Thread Andy Mikhailenko
ry does/will not work in current or upcoming revisions? Thanks! Andy --~--~-~--~~~---~--~~ 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

Re: Separate User namespace

2009-05-20 Thread Andy Mikhailenko
What about using emails or openIDs for authentication? These include namespaces per se ;) On May 20, 1:09 am, Timboy wrote: > Initially we will have in the ballpark of 10,000 Private users. Anyone > have an idea on an additional user namespace? > > On May 19, 8:42 am, Aneesh wrote: > > > How ma

Re: Obfuscate HTML..?

2009-05-25 Thread Andy Mikhailenko
Built-in template tag {% spaceless %) can do a part of work for you (namely, remove the extra whitespace), but to actually obfuscate the code you should either use middleware or make extensive use of JavaScript (e.g. open GMail and try to read the source). However, the idea in general sounds stran

Re: When to use admin, and when not to.

2009-05-27 Thread Andy Mikhailenko
rs out of the admin app entirely, and reserving the latter > only for Facebook staff. > > Or would you take some other approach? > > Please explain your answer, and link to documentation where relevant. > > Many thanks! > > Sam -- Cheers, Andy --~--~-~--~~---

Re: Do you use a skeleton for new django sites?

2009-06-03 Thread Andy Mikhailenko
I used to use a skeleton, but the problem was that I couldn't easily upgrade the already "forked" projects to a newer version of the skeleton; I had to manually backport all changed to each project. The solution I finally adopted is to have a wrapper for site configuration (settings and urls) as

Ignoring the word "The"

2009-06-03 Thread Andy Dietler
Is there an easy way to ignore the word "The" when returning a list using "__startswith=" in Django/Python? I've looked around but it's hard to make any ground when searching for the word The. --~--~-~--~~~---~--~~ You received this message because you are subscri

Noobie question about getting form data to save to the database

2009-06-04 Thread Andy Dietler
ry in the shows_show table. Anybody out there willing to take a look at this incredibly simple code and give me a pointer or two about what is wrong, what I need to add to get that working. Thanks a ton. - Andy 3 pertinent files: models.py - from django.db import models from django impo

Re: Noobie question about getting form data to save to the database

2009-06-05 Thread Andy Dietler
od == 'POST': >         form = AddShow(request.POST) >         if form.is_valid(): >             form.save() >             return HttpResponseRedirect('/shows/#success') >     return HttpResponseRedirect('/shows/#error') > > On Jun 4, 7:39 pm, Andy  Die

Getting radio boxes with ModelForm

2009-06-08 Thread Andy Dietler
__init__() got an unexpected keyword argument 'widget' Any help would be much appreciated. - Andy rating_choices = ( (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), ) class Rating(models.Model): rating =

Re: Getting radio boxes with ModelForm

2009-06-08 Thread Andy Dietler
),label="") On Jun 8, 1:18 pm, Daniel Roseman wrote: > On Jun 8, 8:23 pm, Andy  Dietler wrote: > > > > > > > I'm trying to make one of the fields in my model display radio buttons > > with the options 1-5. I can't find a way to do this with a

Reusing fields in forms

2009-06-10 Thread Andy McKay
I've got a bunch of fields in a bunch of forms. Some of those fields repeat themselves. So rather than copy and paste them around, I defined the fields in a module and then imported them. Then pulled them into my forms. All well and good. The problem is that the fields are coming out in the wrong

URL Patterns for URL Encoding Symbols

2009-06-11 Thread Andy Dietler
fice/ How do I get it to accept the %20? Thank in advance. - Andy --~--~-~--~~~---~--~~ 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 unsu

Re: URL Patterns for URL Encoding Symbols

2009-06-11 Thread Andy Dietler
Awesome thanks. I love the Django community. On Jun 11, 7:03 pm, Thomas Sutton wrote: > Hi Andy, > > 2009/6/12 Andy  Dietler : > > > > > > > > > Right now I've got a URL pattern that works for letters and numbers, > > but when a character like %2

Re: Is Django easy to learn and use for my web project?

2009-06-14 Thread Andy Mikhailenko
i'm an php programmer, very-very new to python, and i think i learn > django before python :-p > > ^_^ -- Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: WebFaction + Django Fixture: Help?

2009-06-17 Thread Andy McKay
On 17-Jun-09, at 12:48 PM, Keyton Weissinger wrote: > backends/util.py", line 19, in execute >return self.cursor.execute(sql, params) > DataError: value too long for type character varying(4) > > > Any ideas? The unhelpful answer is that the field is too long. One way to get this is to hav

Re: How do I create project independent apps.

2009-10-06 Thread Andy Mikhailenko
Another way is to use a settings wrapper such as django-harness[1], which: * helps organize apps (by name, without the notion of project) and eliminates the need to write absolute paths for templates, sqlite database and such stuff stored in the project directory; * simplifies version control of p

Re: Django methodologies and best practices

2009-10-20 Thread Andy Mikhailenko
I usually start with defining goals, actors and use cases, continue with UML class diagrams and UI mockups on paper, and then transfer all that to Python in this order: models, urls, views, templates. Then I manually populate the DB with some data, dump a fixture and periodically reset the app dat

Re: Does anyone know what happened to djangopluggables.com?

2009-10-21 Thread Andy McKay
> I've been seeing that for a few months now when trying to visit the site. Before djangopluggables has been dead for many months. Before it went offline, I spidered everything into http://djangozen.com/, its been growing slowly since then. -- An

Re: Making the case for Django (vs. Drupal)

2009-10-31 Thread Andy McKay
the CMS problems. Drupal like most CMS's will allow you to do things the Drupal way quite easily. As soon as you stray from that path, you'll be in trouble. I recommend understanding your audience and the difference in tools and how this affects them. -- Andy McKay www.clearw

Re: how to save a forms.ModelForm with extra fields?

2009-11-12 Thread Andy Mckay
ce and the rating instance (I'll > get the user from the context)? Sure that works just fine. When you save the form, you'll save the restaurant instance. You can then get the rating from the forms.cleaned_data and save that however you'd like. -- Andy McKay @clearwi

Re: Help a Rails refugee - how to do site specific layouts?

2009-11-12 Thread Andy Mckay
7;s always "include" http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance -- Andy McKay @clearwind Training: http://clearwind.ca/training/ Zen: http://djangozen.com -- You received this message because you are subscribed to the Google Groups "Django

Re: How to use French accent on django template?

2009-11-14 Thread Andy Mikhailenko
The problem is not in templates. Probably either a view or a template tag does something wrong to the caption string. If Django hides the traceback, try testing each module separately. The simplest way to evade the "raise wrapped" is to raise an exception right _before_ rendering data prepared by y

Re: ManyToOne to auth.models.User

2009-11-15 Thread Andy Mckay
put the year on that. Or use model inheritance. Or make a foreign key on another model to the User object (as Dennis noted) and then use reverse lookups. Personally I would recommend making a profile, you'll likely be adding more to it. -- Andy McKay, @clearwind Training: http://

Re: Stucked in template language

2009-11-15 Thread Andy McKay
better off formatting all your data in the view, its easier to write and unit test in Python. -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Redirect

2009-11-15 Thread Andy McKay
On 09-11-15 9:35 AM, Zeynel wrote: > how do i redirect www.swimswith.com to www.swimswith.com/admin/ http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-redirect-to First hit in Google. -- Andy McKay, @clearwind Training: http://clearwind.ca/train

Re: DB table hook/callback

2009-11-16 Thread Andy McKay
ing for any changes on the table and then does some work (in this case updating navigation and search). This lets me stay in the Django ORM as much as possible, with the addition of just one trigger. -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ -- You received this mess

Re: Django and reportlab table question

2009-11-16 Thread Andy McKay
= [] for vehicle in vehicles: data.append([vehicle.ve_name, vehicle.ve_type]) Then expand. Looping through your query set and your models is pretty much the same be it reportlab or not. -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ -- You received this message because you

Re: Apache/mod_wsgi woes

2009-11-19 Thread Andy McKay
python. If you installed mod_wsgi through a package manager, which Python does it use 2.5 or 2.6 (I don't know the answer to that, but the traceback might). Do you have multiple pythons on your machine? -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ -- You received

Re: FAQ?

2009-11-19 Thread Andy McKay
On 09-11-19 7:57 AM, Carl Zmola wrote: > Does anyone want to take a stab at an FAQ? There are a lot of repeated > questions on the list. How about http://docs.djangoproject.com/en/dev/faq/ -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ -- You received this m

Re: querySet + select distinct

2009-11-19 Thread Andy McKay
using values in the filter eg: Disposal.objects.values("mydate").filter(mydate__year__gte=2008).distinct() The problem is the default django query selects all the fields, messing up the distinct part. http://docs.djangoproject.com/en/dev/ref/models/querysets/#values-fields --

Re: Write debug error to file

2009-11-26 Thread Andy McKay
You should take a look at Arecibo which has been used by a few Facebook apps for that very readson. It has full Django libraries and if you don't use it a full example of how to use middleware to process an error. http://areciboapp.com -- Andy McKay www.clearwind.ca On 2009-

Re: Error when generating PDF

2009-11-26 Thread Andy McKay
You are passing through None to reportlab, not a string. Follow the traceback and you will find the line in your code where the error occurs. -- Andy McKay www.clearwind.ca On 2009-11-26, at 5:40 AM, adelaide_mike wrote: > In my report generating view I have this (snip): >

Re: Newbie: is it possible to re-render a tag/filter after adding it to the web page as string

2009-11-26 Thread Andy McKay
> Can anyone tell me how I can load the content and execute/render the > javascript, css styling, template tags/filters? You really shouldn't be doing this. One string is everything on your page? You can use the Template library to re-render a template and that's discussed in the templating d

Re: Newbie: is it possible to re-render a tag/filter after adding it to the web page as string

2009-11-27 Thread Andy McKay
into the HTML area and magic would happen. Sadly it didn't work out very well. I would recommend a simple "add map to this page" button myself that twiddles a model attribute. -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ Whistler conference: http://c

Re: Help with installing MySQLdb package for Django on OS X Snow Leopard

2009-12-02 Thread Andy Dustman
To sum up (because I've been helping him off list too): It looks like he had old versions of setuptools and XCode (from OS X 10.4, running 10.6). I think once XCode gets upgraded, he should be OK... assuming MySQL is actually installed... As for ZMySQLDA: SourceForge features the most release of a

Registration open for DjangoSki Conference, March 2-4 2010

2009-12-03 Thread Andy McKay
p://www.clearwind.ca/djangoski/keynotes.html [2] http://www.clearwind.ca/djangoski/keynotes.html#pre [3] http://www.clearwind.ca/djangoski/when.html [4] http://www.clearwind.ca/djangoski/register.html [5] ...and oh, it's snowing like crazy: http://bit.ly/8goJIc -- Andy McKay, @cl

Re: Performance monitoring

2009-12-09 Thread Andy McKay
wrote to track the time of each sql query. But I would classify both as debugging tools. Is there anything specific you are looking for? -- Andy McKay, @clearwind Training: http://clearwind.ca/training/ Whistler conference: http://clearwind.ca/djangoski/ -- You received this message b

Re: Performance monitoring

2009-12-09 Thread Andy McKay
On 09-12-09 8:43 PM, Kegan Gan wrote: > Thanks for reply, Andy. > > I am aware of django-debug-toolbar. I am looking something to run with > production. > > How do people monitor Django application performance in production > environment today? Hmm I guess if I knew what y

Re: Howto output rows as HTML columns instead?

2009-12-13 Thread Andy McKay
the data just the way you want to work easily in your template and that's just (hopefully) simple Python data structure manipulation. Good luck fitting all those 000's in for their expenses for the duck pond and the adult movies ;) -- Andy McKay, @clearwind Whistler confe

Re: Filter (AND excluding empty values)

2009-12-13 Thread Andy McKay
ry is meaningful on property this would be: Property.objects.filter(category=c)... All I can really say is: http://docs.djangoproject.com/en/dev/ref/models/querysets/ > OR doesn't work properly as well as AND If you want help you will need to be more specific. "doesn'

Re: Filter (AND excluding empty values)

2009-12-14 Thread Andy McKay
A filter can take a python dictionary. So all you have to do is: Property.objects.filter(**some_dictionary) All you have to do is populate that dictionary. You can do that by accessing request.get, but the best way is to pass that into a django form. -- Andy McKay, @clearwind

Good examples or references

2010-04-22 Thread andy saksena
Hi all, I'm a newbie in Django and was wondering if there are any good examples/referneces of Django driven websites. Also if there is a link to make a website using django tutorial apart from the django- documentation It will be really good to know. thanks -- You received this message because y

Re: Working for a startup.

2010-04-22 Thread Andy McKay
is going better. And I bet few of them are to do with Rails. -- Andy McKay, @andymckay Django Consulting, Training and Support -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegr

Re: multiple django instances, one database?

2010-04-22 Thread Andy McKay
ango code can be shared on the same drive, but the > django instances running separately of course (apache/mod_python). > > Is it possible to have two instances accessing the same database? How > do you handle load-balancing? Yes you can. There's lots of options, http://www.apsis.ch

<    1   2   3   4   5   6   7   >