Re: Payment Gateways

2011-03-08 Thread David Zhou
I use Braintree, and it's been great. -- dz On Tue, Mar 8, 2011 at 4:40 PM, CLIFFORD ILKAY wrote: > On 03/08/2011 09:59 AM, Bill Freeman wrote: >> >> And I can't resist recommending solutions that don't require your to touch >> the credit card number.  If you never had it, you can't be respons

Re: How to aggregate values by month

2010-11-04 Thread David Zhou
FWIW, on Postgres DBs, I've done the following: qs = FooModel.objects.filter(date__gte=start_date, date__lt=end_date).extra(select={'datetrunc': "date_trunc('month', date)"}).values('datetrunc').annotate(total=Sum("value")) date_trunc in postgres also accepts "day" and "week" truncations. -- dz

Re: DjangoCon 2011

2010-09-27 Thread David Zhou
Is the bay area right out for cost reasons? dz Sent from my iPhone On Sep 27, 2010, at 8:48 PM, Samuel Baldwin wrote: > 2010/9/27 Franklin Einspruch : >> May I humbly suggest Boston? > > Another for Boston. > -- > Samuel Baldwin - logik.li > > -- > You received this message because you are sub

Re: TemplateDoesNotExistError makes no sense

2010-04-11 Thread David Zhou
On Sun, Apr 11, 2010 at 4:26 PM, Dexter wrote: > I have a server running with primarily nginx and secundary apache2, > And I am getting an template error trying to browse an app. It seems it > cannot find a template, but it is certainly there, the runserver just works > fine. Everything in progr

Re: django template blocks and jquery

2010-02-16 Thread David Zhou
There are a couple of ways, but here's one off the top of my head: Base template: $(function(){ function1() { ... } function2() { ... } {% block additional_domready %}{% endblock %} }); {% block additional_js }%}{% endblock %} child template that extends base template: {% block add

Re: Expiring view caches

2010-02-11 Thread David Zhou
Check out this snippet: http://www.djangosnippets.org/snippets/936/ Some what old though (2008), so it might need updating to work properly. -- dz On Thu, Feb 11, 2010 at 4:18 PM, HARRY POTTRER wrote: > Is there any way to manually expire per-view caches? > > I have a view that executes betw

Re: WebFaction warning

2009-11-29 Thread David Zhou
On Sun, Nov 29, 2009 at 9:18 PM, digicase wrote: > I received a good email From Remi at WF which told me all I needed to > know. The outage was unacceptable but hopefully lessons have been > learned. Do you mind sharing what he said? I'd be curious to know if any new controls have been put into

Re: {% url in templates

2009-10-28 Thread David Zhou
What's your 'view_xyz'? Are you sure that view_xyz is accessible through an URL without any arguments? -- dz On Wed, Oct 28, 2009 at 2:55 PM, Umapathy S wrote: > Hello there, > > I am developing a page which has a left side menu. This menu is a seperate > html and gets includes in the base.h

Re: Django-cms

2009-10-26 Thread David Zhou
On Mon, Oct 26, 2009 at 4:16 AM, aju mathew wrote > > In Django CMS any blog plugin is available. You should be using the Django-CMS mailing list for this in the future. That said, use CMS_PLACEHOLDER_CONF to specify which plugins are available for which placeholders: http://www.django-cms.org

Re: Is slugify available as a Django API call?

2009-09-13 Thread David Zhou
On Sun, Sep 13, 2009 at 9:07 PM, W.P. McNeill wrote: > the web, but this seems error prone.  The right way to do it would > seem to be to use the slugify code that is already in Django. > What is the best way to slugify an arbitrary string using a Python > call? from django.template.defaultfil

Re: Problem building data structure for Archive page

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 10:10 AM, gnijholt wrote: > Or is there a better way to generate a full archive page (per year, > per month)? You'll need to test this, but you should be able to do that with {% ifchanged %}: #view: posts = Posts.objects.order_by('-pub_date') #template {% for post in po

Re: How to check which form was submitted?

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 7:33 AM, Maksymus007 wrote: > > On Thu, Aug 27, 2009 at 1:22 PM, David Zhou wrote: >> Post the part of your view that handles your forms. > > Nothing special > >    if request.method == 'POST': >        form = RegisterForm(re

Re: redirect in django

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 6:58 AM, Matthias Kestenholz wrote: > >> On Thu, Aug 27, 2009 at 2:59 PM, ankit wrote: >>> >>> I am new to django.I having to app in my admin.Know I want to know >>> that how can i redirect user to one app listpage if clicks save on >>> second app.say from app2 to app1 >>>

Re: get an object's model name

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 7:08 AM, Léon Dignòn wrote: > from django.contrib.auth.models import User u = User.objects.get(id=1) u > print u > leon type(u) > Alternatively: >>> u.__class__.__name__ 'User' -- dz --~--~-~--~~~---~--~~ You re

Re: How to check which form was submitted?

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 7:09 AM, Maksymus007 wrote: > > I've got two different form on the same page, under the same URL. > When I send one of them, the second one gets validated too. > I set prefixes but no change. > > Is there any way to distinguish between two forms, choosing one that > have be

Re: Django scalability with files

2009-08-27 Thread David Zhou
On Thu, Aug 27, 2009 at 6:13 AM, Lewis Taylor wrote: > > I have an imagefield that i want to create a thumbnail for on approval > of the image. The problem is (setup is 2 django instances, load > balancer and DB) if the image is stored on one machine it's not the > cleanest solution to have to get

Re: How I can add new functionality in homepage of admin site??

2009-08-24 Thread David Zhou
On Mon, Aug 24, 2009 at 3:29 PM, sandravigo wrote: > > Hi, friends. I have a problem. > I created a function (main) that displays a list on the first page > (index.html) of site administration. The problem is that for example, > if I put in URLConf: (r '^ admin /(.*)',' myproject.views.main '), >

Re: a bit like permission, but...

2009-08-21 Thread David Zhou
On Aug 21, 2009, at 9:54 AM, MIL wrote: > this works fine but I dont want to repeat it in all my views: > def my_profile(request): > gotta_go_through = request.user.get_profile > ().gotta_go_through_this_url() > if gotta_go_through and gotta_go_through != request.path: >

Re: django template language issue

2009-08-17 Thread David Zhou
On Mon, Aug 17, 2009 at 6:39 AM, Adonis wrote: > My problem is that even if the 'projects' queryset is empty, it still > includes the projects.html > Is there another way to do it? If you're using at least Django 1.1, you can use the empty tag: http://docs.djangoproject.com/en/dev/ref/templates

Re: Using glovar vars

2009-08-17 Thread David Zhou
For what you describe, you're not looking for "global" variables in the sense that you want some value persisted in the same process. You're looking at session variables, which are variables persisted for a specific user session. See: http://docs.djangoproject.com/en/dev/topics/http/sessions/ H

Re: digg style pagination

2009-08-14 Thread David Zhou
http://tinyurl.com/mj29fw -- dz On Fri, Aug 14, 2009 at 2:54 PM, sniper wrote: > > I am trying to do pagination. Just wanted to know if there is a > shortcut to show digg style pagination or i have to write my own? > I am asking this because in the admin page, the list page uses digg > style p

Re: logic in templates

2009-08-12 Thread David Zhou
The easiest way is probably moving that list to the view. For example customers = Customer.objects... sellers = Seller.objects... filtered_list = [pair for pair in zip(sellers, customers) if pair[0].customer_id == pair[1].id] Then pass filtered_list into the template context. Inside the templ

Re: How to get rid of the 'u'? Seems to be everyhere :)

2009-08-08 Thread David Zhou
See: http://diveintopython.org/xml_processing/unicode.html -- dz On Sat, Aug 8, 2009 at 11:27 PM, Joshua Partogi wrote: > u' stands for Python unicode. > > On Sun, Aug 9, 2009 at 12:03 PM, strotos wrote: >> >> Hey all, >> >> I am very new to Django and am having a bit of trouble with somethi

Re: marrying django to twitter

2009-06-30 Thread David Zhou
On Tue, Jun 30, 2009 at 11:21 PM, Kenneth Gonsalves wrote: > > has anyone succeeded in marrying django to twitter - that is broadcasting > updates in the django db to twitter? I did see one post on the subject in the > archives, but there was no information as to whether the operation was > succe

Re: runserver fails

2009-05-24 Thread David Zhou
Does the following worth in the interactive prompt? >>> import socket >>> socket.getaddrinfo("www.google.com", 80) -- dz On Sun, May 24, 2009 at 10:59 PM, Chris DPS wrote: > > When I execute runserver, I get the following message: > > Validating models... > 0 errors found > > Django version

Re: Obfuscate HTML..?

2009-05-24 Thread David Zhou
On Sun, May 24, 2009 at 9:40 PM, jago wrote: > > I want to make the HTML of the website as little human readable as > possible. For that I would like to add some layer to Django 0.96 which > when writing out the page takes the HTML and adds some processing. > > 1. How would I obfuscate the HTML a

Re: disable django cache

2009-05-14 Thread David Zhou
On Thu, May 14, 2009 at 9:53 PM, online wrote: > > Whatever i changed 'home.html' to other page i always get the same > result. Are you restarting your serving? If by "changed home.html to other page" you mean you modified your view function to return a different template, then make sure you re

Re: class for form fields

2009-05-11 Thread David Zhou
On Mon, May 11, 2009 at 12:04 PM, CrabbyPete wrote: > > I just started using forms and I have the following html > Zip Code: size="15" maxlength="15"> > > How do you specify the class type for the input field. See: http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.att

Re: Best Convension for dealing with variables needed in every view.

2009-03-29 Thread David Zhou
; do what I need.  Once my context_processor is made how would I add it > to this list?  Something like > settings.TEMPLATE_CONTEXT_PROCESSORS.append(my_processor) > > > On Mar 29, 7:19 pm, David Zhou wrote: >> On Sun, Mar 29, 2009 at 7:14 PM, IanR wrote: >> > I'm trying to stay a c

Re: What hash algorithm does django auth use?

2009-03-29 Thread David Zhou
On Sun, Mar 29, 2009 at 9:50 PM, Joshua Partogi wrote: > > I thought we're to use hexdigest ? > > Did I miss something here? You need to salt it: http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/models.py#L20 -- dz --~--~-~--~~~---~--~~ Yo

Re: Best Convension for dealing with variables needed in every view.

2009-03-29 Thread David Zhou
On Sun, Mar 29, 2009 at 7:14 PM, IanR wrote: > I'm trying to stay a close to the suggested Django conventions as > possible.  I have a few variables that I need to render any page. Check out context processors: http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-pro

Re: Design Issue / forward referencing

2009-03-28 Thread David Zhou
Also see: http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField.symmetrical -- dz On Sat, Mar 28, 2009 at 11:57 AM, Alex Gaynor wrote: > > > On Sat, Mar 28, 2009 at 10:55 AM, mahesh wrote: >> >> I am working on a (College) course manager project. Here is a

Re: Avoiding Accidental Overwrite In Admin Interface

2009-03-25 Thread David Zhou
It shouldn't be too hard to add a last-updated timestamp to a model, and compare it to a hidden field in the form validation. -- dz On Wed, Mar 25, 2009 at 11:49 AM, Daniel Watkins wrote: > > Hello all, > > We recently ran into an issue when two people were editing a record via > the admin in

Re: Why won't my form validate?

2009-03-24 Thread David Zhou
ting a ModelForm from an existing > instance would give it valid data, but that's not the case. (Though > the Django Documentation doesn't say this: > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ ) > > > On Mar 24, 12:15 pm, David Zhou wrote: >> If it&#

Re: Why won't my form validate?

2009-03-24 Thread David Zhou
If it's not valid, then something likely threw a validation error. What does the error say? -- dz On Tue, Mar 24, 2009 at 3:11 PM, Theme Park Photo, LLC wrote: > > It has data! It was created from an existing instance...and all the > fields have values > > 'body': u'hello there', 'allow_comme

Re: Removing fields in a form subclass

2009-02-20 Thread David Zhou
edinnick wrote: > > On Fri, 2009-02-20 at 10:15 -0500, David Zhou wrote: >> Suppose I had this form: >> >> class BaseForm(forms.Form): >> field1 = forms.CharField(...) >> field2 = forms.Charfield(...) >> >> And then in a subclass, I had:

Re: Removing fields in a form subclass

2009-02-20 Thread David Zhou
(BaseForm): > field1 = forms.EmailField(...) > > del SubForm.base_fields['fields2'] > > On Fri, Feb 20, 2009 at 6:45 PM, Alex Koshelev wrote: >> >> No. Place this code right after the SubForm definition. >> >> On Fri, Feb 20, 2009 at 6:42 PM, David Zho

Re: Removing fields in a form subclass

2009-02-20 Thread David Zhou
Do you mean del self.fields['field2'] in SubForm's __init__? -- dz On Fri, Feb 20, 2009 at 10:39 AM, Alex Koshelev wrote: > Try this: > > del SubForm.fields['fields2'] > > > On Fri, Feb 20, 2009 at 6:15 PM, David Zhou wrote: >> >> S

Removing fields in a form subclass

2009-02-20 Thread David Zhou
Suppose I had this form: class BaseForm(forms.Form): field1 = forms.CharField(...) field2 = forms.Charfield(...) And then in a subclass, I had: class SubForm(BaseForm): field1 = forms.EmailField(...) What's a good way to remove field2 in SubForm? Setting field2 = None didn't work.

Re: Modifying pythonpath in settings.py

2009-02-18 Thread David Zhou
b 19, 2009 at 12:10 AM, David Zhou wrote: > I've been doing the following for a while, but I'm not sure if it has > unintended side effects: > > #settings.py > import os, sys > sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), > 'apps'

Modifying pythonpath in settings.py

2009-02-18 Thread David Zhou
I've been doing the following for a while, but I'm not sure if it has unintended side effects: #settings.py import os, sys sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'apps')) I keep pluggable apps in an svn repo, and do checkouts of the ones I need in the apps folde

Re: Cannot serve static files

2009-01-22 Thread David Zhou
On Thu, Jan 22, 2009 at 10:53 AM, john wrote: > > No matter what i do i can't get my css to load. 100% Frustrated with > Django. My index page loads when i request http://127.0.0.1:8000/ but > it is not styled. Django dev server returns 404 in console for "GET / > css/styles.css HTTP/1.1" Try do

Re: django 0.96 cancel template render automatically escape?

2009-01-12 Thread David Zhou
autoescaping later on. What you put in your template is what you got. -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: new django user - no images appear on my site :(

2009-01-12 Thread David Zhou
et a Django error? If so, what is it? -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ 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.

Re: overriding Model.save(), do I need to override Model.create() also?

2009-01-12 Thread David Zhou
t's considered best practice. -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ 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.

Re: CSS is not updated?

2009-01-12 Thread David Zhou
hen I spend an inordinate amount of time wondering why my changes aren't working when I was editing the wrong copy of the file the entire time. -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: newforms library.

2009-01-12 Thread David Zhou
> original forms and allow for easier migration. seki, this is why it's always been recommended to do "import newforms as forms", since that allowed easier migration when newforms was renamed and replaced forms. -- --- David Zhou da...@nodnod.net --~--~-~--~~---

Re: Templates Cant find the CSS file

2009-01-12 Thread David Zhou
re? See: http://docs.djangoproject.com/en/dev/howto/static-files/ And if you're using mod_python, also see: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-media-files -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ You r

Re: why 'No module named safestring'?

2009-01-11 Thread David Zhou
.com/browser/django/tags/releases/0.96/django/utils -- --- David Zhou da...@nodnod.net --~--~-~--~~~---~--~~ 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@googlegro

Re: Django too slow

2009-01-07 Thread David Zhou
o avoid so that it becomes faster First thing you need to do is figure out where the slowness originates. Is it from DB access? XML generation? If it's from DB access, include the code you're using to fetch data. If XML generation, likewise. -- --- Da

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread David Zhou
On Mon, Jan 5, 2009 at 3:57 AM, Kenneth Gonsalves wrote: > > On Monday 05 Jan 2009 2:10:34 pm David Zhou wrote: >> >> and covers a lot of materials. >> >> What do you think? >> > >> > As the author, I recommend waiting a couple months. >> &

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread David Zhou
ems to me that "The Definitive Guide To Django" is more organized >> and covers a lot of materials. >> What do you think? > > As the author, I recommend waiting a couple months. Are you planning to update Practical Django Projects to 1.0? -- --- David Zhou da...@nodnod.n

Re: keep html

2008-12-07 Thread David Zhou
browsers have some such way to see the raw html > for a page.) Or am I misunderstanding your question? If the question is getting at the actual admin site templates, see: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates -- --- David Zhou [EMAIL PROTECTED]

Re:

2008-12-05 Thread David Zhou
them in a new tab or anything of that nature? -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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

Re: Ruby on Rails vs Django

2008-12-05 Thread David Zhou
iffer much more than Python and Ruby. > There are "small" differences between Python and Ruby, but the core > philosophies and structures of Rails and Django on the other hand are > completely unrelated and pretty much incompatible. What do you think are the core philosophies of Rails and

Re: Populating form from instance not working

2008-12-05 Thread David Zhou
djangoproject.com/en/dev/topics/forms/modelforms/ What does your form class look like? -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Django is changing my html!

2008-12-04 Thread David Zhou
ht, since you had the inside the . Fix the markup, and it'll be fine, doctype and all. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: cursors and raw sql

2008-12-04 Thread David Zhou
or? Assuming it's following standard Python database API practices, you can, if you want, but it's optional. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: how to create json from template?

2008-12-02 Thread David Zhou
On Wed, Dec 3, 2008 at 1:17 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > To trim last colon wrap it with if statement: > > {% if forloop.revcounter0 %},{% endif %} You can also do: {% if not forloop.last %},{% endif %} Which, IMO, is slightly more clear. --- David Zho

Re: printing from the admin?

2008-12-01 Thread David Zhou
it with a custom CSS file but I hope there is a simple way. > Is there? If you want the layout to be print optimized, the easiest way is going to be using some custom admin templates that use some custom CSS. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~

Re: Does Django have a function that can be called by every view function ?

2008-11-30 Thread David Zhou
On Mon, Dec 1, 2008 at 2:23 AM, David Shieh <[EMAIL PROTECTED]> wrote: > I dont' know whether this make any sense . > Right now , I can't test it , but if django won't initiate the > views.py as a class , this method will make no sense. Why not write a dec

Re: Injecting stuff to an existing list?

2008-11-25 Thread David Zhou
On Tue, Nov 25, 2008 at 9:05 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > > David Zhou wrote: >> On Tue, Nov 25, 2008 at 3:55 AM, sajal <[EMAIL PROTECTED]> wrote: > [...] >> >> Personally, if the current age of a person is something you'll be >>

Re: Injecting stuff to an existing list?

2008-11-25 Thread David Zhou
} for person {{person}} {% endfor %} Personally, if the current age of a person is something you'll be using often, I'd add it to the model. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Executing raw Python

2008-11-24 Thread David Zhou
t;> >> Thanks, >> Alex >> > >> > > > -- > Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 > Freelance developer web:http://www.sieker.info/profile > SAP-Developer > > > > -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~--

Re: parameter not getting passed to view function

2008-11-24 Thread David Zhou
T" > > urls.py >(r'^hello/(?P)\S+/$', 'swamiji.poll.views.hello') Check your URL regexp and grouping. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &

Re: Why are models referenced without a capital letter in templates

2008-11-23 Thread David Zhou
and how they pass things to the template context. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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

Re: Why are models referenced without a capital letter in templates

2008-11-23 Thread David Zhou
s > first letter is automatically converted to lower case. > > Am I on the right lines here? If so, what happens if you declare your > classes with all lower case letters in models.py? > > > Thanks, > > > -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~-

Re: serving static file via django

2008-11-18 Thread David Zhou
it its ok inproduction env though.. Do you not know which pages the gif will live on? Why not grab visitor data in the views of the pages that use the transparent gif? -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because

Re: serving static file via django

2008-11-18 Thread David Zhou
gt; made to this file. used in generating internal metric reports. I guess > i'll have to dig into the django code to see how signals are used..do > you know of any example where the request_finished signal is used ? > > thanks, > -p > > On Nov 18, 10:23 pm, "David Zho

Re: form issue

2008-11-18 Thread David Zhou
I'm getting the following error: > > global name 'form' is not defined > > > am I missing something? > > > -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &q

Re: serving static file via django

2008-11-18 Thread David Zhou
rack requests in Django in general, you may be able to do that by using a listening for a request finished signal, and doing something with it. What are you specifically trying to do by tracking which users requested the file? -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~---

Re: Show image (but not ImageField) in admin?

2008-11-18 Thread David Zhou
> CharField instead of ImageField, but then how do I go about showing it > inline? fieldsets.description doesn't allow anything but text. You can write your only readonly image widget, and apply it in the admin by specifying your own form: http://docs.djangoproject.com/en/dev/ref/contr

Re: serving static file via django

2008-11-18 Thread David Zhou
of using > this view in a production env ? Have you considered using request/response signals? http://docs.djangoproject.com/en/dev/ref/signals/#module-django.core.signals -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this messa

Re: Passing values to template

2008-11-18 Thread David Zhou
ist has different 'types' of renderings. My way put that logic into me template, but ideally, as Bruno said, each 'type' should be able to dispatch its own specific render. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You rec

Re: Multiple types of output (HTML, JS), same view.

2008-11-18 Thread David Zhou
ibility is to give the decoration a "block" parameter, to render a specific block from a template. So you could have something like: @render_view('js', 'template.html', block='js_block') def view: pass -- --- David Zhou [EMAIL PROTECTED] --~--~

Re: Passing values to template

2008-11-17 Thread David Zhou
is other > than mixing objects and dictionaries in the list? What about making it a list of tuples, and including a type? {'articles': [('single', ), ('multiple', {1: , 2: }), ('single', )]} Then you could just do a {% for type, article in articles %}, and

Re: avoid cascade delete

2008-11-17 Thread David Zhou
e. And, IMO, the vast majority of foreign key use cases do benefit from an auto cascading delete. For the specific Links/Groups example, personally I'd just do it with a many to many relation. It's entirely feasible that in the future, Links will need the ability to associ

Re: avoid cascade delete

2008-11-16 Thread David Zhou
On Mon, Nov 17, 2008 at 2:34 AM, David Zhou <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 2:21 AM, Merrick <[EMAIL PROTECTED]> wrote: >> >> How do I avoid the default behavior that does a cascade delete. Of >> course I could use the cursor but would am

Re: avoid cascade delete

2008-11-16 Thread David Zhou
gt; How do I avoid the default behavior that does a cascade delete. Of > course I could use the cursor but would am hoping there is some option > I don't know of for delete(). Try using clear() prior to deleting: http://docs.djangoproject.com/en/dev/topics/db/queries/#following-relation

Re: In forms, how add dynamic initial values out of reach for clients?

2008-11-16 Thread David Zhou
isitors/clients. > ... > How should i solve this? I've tried numerous ways but none of them > really worked. http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---

Re: cascading drop down lists

2008-11-16 Thread David Zhou
ev/ref/contrib/formtools/form-wizard/#django.contrib.formtools.wizard.FormWizard.process_step -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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@googleg

Re: Best way for making a "Poll"?

2008-11-16 Thread David Zhou
topics/forms/#customizing-the-form-template -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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.c

Re: Multithreaded Dev Server

2008-11-15 Thread David Zhou
e one of the pure python servers out there. See: http://www.eflorenzano.com/blog/post/hosting-django-site-pure-python/ -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djang

Re: Multithreaded Dev Server

2008-11-15 Thread David Zhou
the second > request just hangs until the file upload completes, preventing the > status update. Is there any way to make the dev server multi-threaded? It's probably easier to just use apache at that point. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---

Re: ' Change History' for audit, compliance

2008-11-11 Thread David Zhou
e data , the old value and the new value etc > That's a debatable point, but it would be fairly easy to create a Change model, and either define save() methods or use pre/post save signals to populate changes so that you have a change hist

Re: Beginner on Django and web developing

2008-11-03 Thread David Zhou
o is that a lot of the older documentation and literature may no longer apply. The good news is that once you learn Django 1.0, there shouldn't be any future breaking changes for some time. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received

Re: Beginner on Django and web developing

2008-11-03 Thread David Zhou
ty out of date at this point, and some sections -- like the Admin site -- will simply not work. Your best bet is to go through the tutorials on the Django documentation site. David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message be

Re: actual django stack

2008-09-26 Thread David Zhou
ation stuff or additional security > hardening. This will probably be the case for many teams since Nginx > is so new. I've also heard good things about WSGI -- though I haven't heavily tested its stability compared to, say, mod_python. --- David Zhou [EMAIL PROTECTED] --~--~

Re: Recommendations for local web dev on Mac OS X 10.5 vs. developing against WebFaction Linux box

2008-09-15 Thread David Zhou
, if you're used to VIM at all, MacVim (http://code.google.com/p/macvim/) is pretty awesome. --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: Running into errors using S3 backend for Django

2008-09-14 Thread David Zhou
n't support absolute paths. Sounds like you just need to define that method for the S3 backend. It's falling back on the base method that spits out the exception. --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this messa

Re: Restricting views

2008-09-11 Thread David Zhou
d permissions. I usually do so anyway, in case I need to change how permission works in the future. --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Internal server error upgarding from 0.97 to 1.0

2008-09-09 Thread David Zhou
gednewforms-adminintotrunk Specifically, the "Changed prepopulate_from to be defined in the Admin class, not database field classes" section. --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: disable delete checkbox in Inline formset

2008-09-08 Thread David Zhou
On Sep 8, 2008, at 2:55 PM, Kurczak wrote: > On 8 Wrz, 20:37, David Zhou <[EMAIL PROTECTED]> wrote: >> On Sep 8, 2008, at 2:30 PM, Kurczak wrote: >> >>> Is there any way to disable/remove the delete checkbox for inline >>> formsets ( in admin) ? >

Re: Double Slash in URL

2008-09-08 Thread David Zhou
t is to allow variable amounts of slashes -- like: (r'^test/+$', 'modwork.views.test.index'), --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: disable delete checkbox in Inline formset

2008-09-08 Thread David Zhou
viously I can > disable the "Can delete" permission, but the ugly box is still there. Have you tried editing the admin templates to not show the checkbox? --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are

Re: Introducing django-cms

2008-09-08 Thread David Zhou
e set up which allows you to play around with the admin > interface. > > The software is still in development and we would appreciate any > feedback and contributions. > > Greetings from Switzerland, > > Thomas Stei

MediaTemple Django Containers

2008-09-04 Thread David Zhou
Are now available according to their homepage: http://mediatemple.net/webhosting/gs/django.html Was anyone in the beta? I've not used them, so I'm wondering what the experience was like. --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ Yo

Re: How to display Html in my screen

2008-09-02 Thread David Zhou
t? Django autoescapes. See: http://docs.djangoproject.com/en/dev/topics/templates/#how-to-turn-it-off --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: django web hosting

2008-09-02 Thread David Zhou
am looking for a good web host for my django website. does anyone > suggest a good host? thanks. > > > > > > -- > Nikos Delibaltadakis > > > --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message bec

Re: django web hosting

2008-09-02 Thread David Zhou
I've had pretty good experiences with WebFction. David Sent from my iPhone On Sep 2, 2008, at 7:30 PM, Ed Wong <[EMAIL PROTECTED]> wrote: > > hi all, > > i am looking for a good web host for my django website. does anyone > suggest a good host? thanks. > > > --~--~-~--~~

  1   2   >