Re: How create M2M through with out PK?

2010-05-19 Thread David De La Harpe Golden
On 19/05/10 10:42, Daniel Roseman wrote: How remove PK from table "libs_content_has_people" and don't use it? You can't. Why would you want to? Well, the natural primary key for a M2M table is quite typically composite and django's ORM just doesn't support composite primary keys right now

Spammer named 'Ashley J. Sands' who harvested everyone's email from djangopeople.net

2010-05-15 Thread David Ross @ Wolfeon
Disregard the email coming from the individual and I don't recommend doing business with such a leech. This guy wrote a program to harvest emails and mass spam using Google Gmail, the access method of SMTP. How I know the guy is a leech: 1) There's no User-Agent header 2) He negligently used the

proposal: subclass generation of forms

2010-05-07 Thread David Koblas
[Not quite sure where the right place is to post this] The general problem is that I would like to change the default output of forms across my site to have a consistent presentation that isn't of one as_p(), as_table(), or as_ul(). What I wanted to do was to add a quick function as_div() as

Re: usage of TIME_ZONE and zone-to-zone conversion

2010-04-28 Thread David De La Harpe Golden
Thanks for the tip on pytz. It might be what I need. See django-timezones, django-related helpers around pytz: http://github.com/brosner/django-timezones its LocalizedDateTimeField model/form fields construct non-naive python datetimes with pytz tzinfo. (see its tests.py for some additio

Re: Why doesn't my isinstance() work?

2010-04-23 Thread David De La Harpe Golden
On 22/04/10 04:34, Lachlan Musicman wrote: I presume this will make you all wince, but while appreciating the discussion I've caused I've solved it thusly: views.py def index(request): all_authors = Author.objects.all() all_origAuthors = [] all_translators = Transl

Re: propagating values up the template chain

2010-04-21 Thread David Koblas
I'm doing that in a few other place (setting the page title, for example). The problem is that I would like to have the extended inside of a block and potentially conditionally (e.g. only include this JavaScript if you're not logged in). --koblas On 4/21/10 4:29 PM, Tim Shaffer wrote: Can y

propagating values up the template chain

2010-04-21 Thread David Koblas
I ask this question knowing that it's almost anti-django template patterns, but I ask after spending the last few hours trying to figure a way to shoe horn this functionality in. The basic idea is that I would like to say something like this: {% extends "base.html" %} {% block content %} {%

Re: Using external dbs... is django 1.2 the best solution?

2010-04-21 Thread David De La Harpe Golden
On 21/04/10 11:21, Massimiliano della Rovere wrote: I am developing a web site that has some of its models in a private database (the one specified in settings.py, populated by the admin interface) but, it has to fetch and filter (etc) data from 2 different databases So what is you opinion, sh

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
return render_to_response(...) On Apr 18, 7:52 am, David Lindquist wrote: > Thanks Georg. I will give that a try. > > On Apr 18, 7:45 am, "ge...@aquarianhouse.com" > > > > > > wrote: > > ok now i got it :) > > > i would do this: &

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
=False) > m.user = request.user > m.save() > > something like this :) > > On Apr 18, 4:32 pm, David Lindquist wrote: > > > > > > > Thanks for the reply. > > > The problem I have with that solution is that it occurs after form > > validation take

Re: Saving a ModelForm for the current user?

2010-04-18 Thread David Lindquist
another way to accomplish this? On Apr 18, 3:14 am, "ge...@aquarianhouse.com" wrote: > use commit=False > > m = form.save(commit=False) > m.user = request.user > m.save() > > On Apr 18, 6:06 am, David Lindquist wrote: > > > > > > > Greetings, > &

Saving a ModelForm for the current user?

2010-04-17 Thread David Lindquist
Greetings, I am trying to solve what seems like an easy problem, but the solution eludes me even after many Google searches. I have a simple model: class Site(models.Model): user = models.ForeignKey(User) url = models.URLField() class Meta: unique_together = (('user', 'url')

Re: How do you rollback a transaction outside the context of a request?

2010-04-15 Thread David De La Harpe Golden
On 14/04/10 23:15, Bill Freeman wrote: The trouble is, I don't know how. Just calling django.db.transaction.rollback() doesn't work, and neither do several other guesses. N.B. Despite eventually signalling a TransactionManagementError if django doesn't "think" it's in a transaction-managed

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-14 Thread David Hollander
I went with Django because of Python. It is a multi-purpose language that is used in the sciences, social sciences, and scripting for software\videogames. Ruby on the other hand is primarily known just for Rails. I also figured Python would be faster and only get faster due to Google's Unladen Swal

Re: how to achieve the break tag in django template

2010-04-12 Thread David De La Harpe Golden
On 09/04/10 12:42, CCC wrote: now i have a finished template which wrote by j2ee,like this: Your template stuff (FreeMarker I think?), well, it is not Django. And Now i want to changeit,write by django,anyone know how to achieve the "<#break>" in this tenplate thanks! Well, you can't (IIRC

Re: Why is django returning only naive datetimes?

2010-04-12 Thread David De La Harpe Golden
On 09/04/10 19:05, Paweł Roman wrote: I've noticed that django always fetches 'naive' datetimes from the database. Tzinfo property on a datetime object is always set to null, even if the database stores a value WITH a timezone. This is a bit tedious because such datetime cannot be later converte

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: CSRF error while working through tutorial part 4

2010-04-08 Thread David De La Harpe Golden
On 07/04/10 18:59, Gang Fu wrote: Following the instruction, my settings.py has Invalid block tag: 'csrf_token' You're likely looking at the development version of the tutorial but using a released version of django. csrf_token is new, and not used with django 1.1.1. contrast: http://docs

Re: Why must {% extends '' %} be first value in template? Inconvenient for ajax versions.

2010-03-28 Thread David Hollander
Goal: produce responses for both ajax and regular requests with a single render_to_response call and no extraneous templates. Solution: 1. dynamic extends. mypage.html: {% extends base %}. base="mybase.html" or "ajaxbase.html" pros: one render_to_response call. cons: Have to create extra dummy temp

Why must {% extends '' %} be first value in template? Inconvenient for ajax versions.

2010-03-27 Thread David Hollander
very inefficient OR violate the DRY principle. What is the best idiom to handle this situation? Thank you for your time. -David -- 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...@googlegroups

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
r, I did not really like this solution for a variety of reasons. [1] http://docs.python.org/library/xmlrpclib.html#xmlrpclib.ServerProxy [2] http://github.com/samuraisam/django-json-rpc On Mar 26, 10:13 am, Simone Orsi wrote: > Hi David, Ale, thanks for your answers :) > > On 03/26/2

Re: xmlrpc + 'django.contrib.auth.middleware.RemoteUserMiddleware' throws "Forbidden"

2010-03-26 Thread David
ubclass the RemoteUserMiddleware [3]. [1] http://docs.djangoproject.com/en/1.1/howto/apache-auth [2] http://code.djangoproject.com/ticket/10809 [3] http://docs.djangoproject.com/en/1.1/howto/auth-remote-user -David On Mar 26, 7:48 am, Simone Orsi wrote: > Hi *, > > I'm trying t

Re: Let Django form render field's with custom attributes (e.g CSS)?

2010-03-26 Thread David De La Harpe Golden
On 26/03/10 13:18, Thierry wrote: Hi, I want to differentiate CSS style of fields from the style of RadioSelects elements (as rendered through RadioFieldRenderer). Immediate action: I could create my RadioFieldRenderer/RadioInput classes to display inner labels as. Any direction you could

Re: High, ongoing CPU consumption

2010-03-26 Thread David Christiansen
Thank you very much, Graham. I'll do some more looking and get back to the list. /David Christiansen -- 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...@googlegroups.com. To unsubs

Re: Django Admin: Redirecting after save

2010-03-24 Thread David Christiansen
erAdmin in django.contrib.auth. This has exactly this behavior when making a new user. /David Christiansen -- 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...@googlegroups.com. To un

High, ongoing CPU consumption

2010-03-24 Thread David Christiansen
string. 2. Has anyone else here experienced anything similar who could shed some light on my situation? Many thanks in advance! /David Christiansen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Issue with aggregate_select changes

2010-03-22 Thread David Cramer
super(ICount, self).__init__(col, source, is_summary, **self.extra) query.aggregate_select[alias] = self On Mar 22, 4:53 pm, David Cramer wrote: > One of the recent changes in trunk was a change to how querysets were > cloned. Due to this, some old code we had is no longer working.

Issue with aggregate_select changes

2010-03-22 Thread David Cramer
One of the recent changes in trunk was a change to how querysets were cloned. Due to this, some old code we had is no longer working. This was a custom aggregate which relied on "aggregate_select" (see below). I believe the change I'm referring to is what is causing this, and I'm unsure of what the

Re: Multiple host-based settings file

2010-03-16 Thread David De La Harpe Golden
On 16/03/10 14:27, Gustavo Narea wrote: Hello, Even if there was a reliable way to reuse the same code base with different settings on a per request basis, which I doubt, I believe the safest and easiest way to extend a base configuration with twod.wsgi: http://packages.python.org/twod.wsgi/manu

ANN: django-admin-tools 0.2.0 released

2010-03-15 Thread David Jean Louis
is to read the quickstart guide: http://packages.python.org/django-admin-tools/0.2.0/quickstart.html Best regards, -- David -- 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...@googlegroups.com.

Re: How execute erlang code ?

2010-03-12 Thread David De La Harpe Golden
On 12/03/10 03:02, nameless wrote: Hi at all. I need to create a blogging system with Django+Apache+Postgresql and a twitter-like app with Erlang+Yaws+Mnesia. How can I execute erlang code through django views ? Well, one option I would seriously consider would be coupling through a message

Re: SQL Server 2008 and django

2010-03-11 Thread David
As the stackoverflow link states, pyodbc is the most advanced sql server library for python. Quite a few libraries use it like sqlalchemy. If you are using Django on Linux, your only options are django-pyodbc or use sqlalchemy outside of the Django ORM. If your environment is on Windows, you can al

Re: custom authentication for admin

2010-03-10 Thread David
against a remote database. I'd look at the code for the remote user classes if that were the case. -David On Mar 9, 1:24 pm, Tim Arnold wrote: > Hi, > I've read about the custom authentication you can do so you can use > upstream validators for your views. And a snippet tha

Re: hi help regarding sharding

2010-03-10 Thread David
ly be writing a custom router to direct your traffic. -David On Mar 10, 2:41 am, chiranjeevi muttoju wrote: > Hi, > i want to use *Sharding* concept in for my project. i requirement is, i have > one user model, and i want to save users by selecting the random databases. > ie. i have

Re: how to start with django

2010-03-08 Thread David Talbot
I would recommend the tutorial at http://docs.djangoproject.com/en/1.1/intro/tutorial01/ if you are just beginning - it gives a very good overview of the main features and programming ideas. On Mar 8, 7:47 am, Subhransu Sekhar Mishra wrote: > hi,i am subhransu and new to django . i want to know

Re: Form initial data is not dynamic

2010-03-05 Thread David De La Harpe Golden
On 05/03/10 01:30, NaMaK wrote: class DateTest(forms.Form): ... in_date=forms.DateTimeField(initial=datetime.datetime.now()) ... Well, note that the now() was executed when python first saw it, which was just a bit after it first saw the class definition. Think about it - it does make se

Re: building a form with multiple filters

2010-03-04 Thread David De La Harpe Golden
On 03/03/10 22:10, Nick wrote: I am trying to build a search form with multiple filters/input objects. Basically, i want to be able to allow for a simple searhc based on one criteria or multiple. So if someone searches the name field(q) they can filter by political party, or city, etc. Also, I w

Re: Restricting Access to Uploaded Files

2010-03-04 Thread David De La Harpe Golden
On 03/03/10 23:35, Merrick wrote: I wanted to give users who are authenticated the ability to upload files, that's the easy part that I can handle. What I cannot figure out is how to restrict the viewing/downloading of files. Links, tips, code are appreciated. This is become quite the FAQ...

Re: SQL Server 2008

2010-03-03 Thread David
using SQLAlchemy/Elixir with pyodbc. -David On Mar 3, 6:52 am, "Steven R. Elliott Jr" wrote: > Hello, > > I have been asked to write a front-end for an accounting system that will > allow business participating in certain benefits plans the ability to > receive and pay thei

Re: session key

2010-02-26 Thread David De La Harpe Golden
On 26/02/10 16:50, Sumanth wrote: Hi , I was trying to access the session key using request.session object in django. To do this we can use request.session._session_key or request.session.session_key out of this which is the right one to use ? The latter, without the leading underscore. This

Re: debugging server code problems in server code that is invoked via ajax request

2010-02-25 Thread David De La Harpe Golden
Possibly useful tip: Note that if you use request.is_ajax() in your django views, you can also use e.g. the "Modify Headers" firefox plugin to simply pretend to django that an ordinary request you've e.g. typed into your browser address bar is an "ajax" request, with a rule e.g. Action Nam

Re: Best practices for restricting media?

2010-02-22 Thread David De La Harpe Golden
On 22/02/10 16:48, Brice Leroy wrote: Hello Brett, If you use nginx you can use the X-Accel-Redirect function. Minor: if you _don't_ use nginx but rather apache or lighttpd, similar feature is called "X-Sendfile". -- You received this message because you are subscribed to the Google Groups "Dj

Re: one form, many submits

2010-02-20 Thread David De La Harpe Golden
On Sat, Feb 20, 2010 at 06:42:11AM -0800, Tom wrote: > Hi all, > > I have a view that iterates over a queryset to produce a list of > items. I have added a checkbox next to each item (from within the > template) and have multiple 'submit' buttons that will do different > things with the items sel

Re: Database relations concepts

2010-02-19 Thread David De La Harpe Golden
On 19/02/10 08:32, Le Quoc Viet wrote: Hi Tim, Thanks for reply. I mean if I want Samurai to be out of all rooms? ForeignKey disallows Null. minor point - ForeignKey(null=True, blank=True) will merrily allow null if your database allows nullable foreign keys at all (chances are it does). It

Re: Best way to access 'request' in pre_save

2010-02-18 Thread David De La Harpe Golden
On 18/02/10 15:55, Paul Stone wrote: I'm trying to find the best way to update a model using data from the request object (e.g request.user) before it is saved. One use case for this is updating an 'updated_by' field on a model. I've come across http://www.djangosnippets.org/sn/ippets/476 which

Re: Multiple user types

2010-02-18 Thread David De La Harpe Golden
On 18/02/10 08:31, Sander wrote: Can you explain yourself a little bit more about the other one to one fields? Well, django has a "OneToOneField" field type, that is like ForeignKey" only assumes the two models are, well, one to one. And thus, the generated reverse relation accessor returns

Re: Multiple user types

2010-02-17 Thread David De La Harpe Golden
On 17/02/10 08:53, bruno desthuilliers wrote: user.get_profile().student.student_number or user.get_profile().teacher.gender - but it works. I'm becoming pretty vague on what advantage the userprofile mechanism offers over other one to one fields to User. Is it just a convention at this stag

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: ANN: django-admin-tools 0.1.0 released

2010-02-14 Thread David Jean Louis
Le 10/02/2010 09:56, David Jean Louis a écrit : Hello, I'm happy to announce the availability of the first public release of django-admin-tools. For those interested in the project, I've setup a mailing list to share ideas on django-admin-tools future developm

Re: Problem while creating database tables through the models.

2010-02-12 Thread David Talbot
Have you created a Postgres database? On Feb 12, 4:38 am, Newbie wrote: > Dear all, > >           Downloaded and followed the steps which is given in the > documentation of Django >           Created the project called mysite >           Created the model called polls >           Ratified the set

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: Custom commands called outside project path

2010-02-10 Thread David De La Harpe Golden
(I'm not sure about that "root" in creecode's version. Editing crontab with crontab -e on a linux box has no user specification because it edits the crontab of the invoking user. Perhaps it's different for a directly edited root crontab.) The system-wide /etc/crontab is different to individu

ANN: django-admin-tools 0.1.0 released

2010-02-10 Thread David Jean Louis
d day, -- David Jean Louis -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. F

Re: how to redirect to another page in if else condition.

2010-02-09 Thread David
Generally, when you are redirecting, you usually aren't returning an HTTP status code of 200. Redirecting implies a status code in [300,400). You might want to take a look at the HttpResponse subclasses: http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses However, if

Re: Date-based generic views - UTC handling

2010-02-08 Thread David De La Harpe Golden
On 07/02/10 18:28, Wayne Dyck wrote: Is there an easy way to format this date_field to my local time zone i.e. PST? I have also tried using the "date" and "time" filters within the template itself, however, those are still UTC. Any pointers would be appreciated. Well, django-timezones has a

Re: Django standards?

2010-02-04 Thread David Parker
rns (granted, I understand what you mean... if it's well tested, then does it really matter which way it is designed?). On Feb 4, 11:08 am, Phlip wrote: > David Parker wrote: > >     verses = Verse.objects.filter(version__iexact=version, > > book__iexact=book, chapter__iexact=chapt

Django standards?

2010-02-04 Thread David Parker
Hey all, I'm working on my first real Django app. I've been tinkering with it since last June, but I actually get to use it now. So my question is about what's the Django standard for what I'm doing... It's a Bible application, and so far, I have a url pattern: urlpatterns = patterns('', (r'^(

Re: Unicode/ASCII problems

2010-02-04 Thread David De La Harpe Golden
On 04/02/10 14:46, bruno desthuilliers wrote: On Feb 4, 9:18 am, Nohinder wrote: Hello, i ran into this problem too, the solution was to specify the page coding from the very begining: " # -*- coding: latin-1 -*-" This is for .py files, not templates. well, just to note, a similar declara

Re: django and ldap

2010-02-04 Thread David De La Harpe Golden
On 04/02/10 08:33, andreas schmid wrote: @brad: can you show me some sample code for this? @david: i tried different configuration options but with no luck, i can bind and search manually over python-ldap so i can definitely connect. There are logging calls liberally sprinkled through the

Re: django and ldap

2010-02-03 Thread David De La Harpe Golden
On 03/02/10 14:45, andreas schmid wrote: AUTH_LDAP_BIND_DN = "" AUTH_LDAP_BIND_PASSWORD = "" AUTH_LDAP_USER_SEARCH = LDAPSearch("dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)") You're using uid here, but # Set up the basic group parameters. #

Re: django and ldap

2010-02-03 Thread David De La Harpe Golden
On 03/02/10 13:41, andreas schmid wrote: hi, i need to authenticate users through ldap but i need also to store their preferences in the database, i cant really understand if django-auth-ldap (http://packages.python.org/django-auth-ldap) only authenticats the users over ldap or if it creates a r

Re: Django FormWizard Dynamically Alter form_list

2010-02-02 Thread David Durham
On Sat, Jan 30, 2010 at 1:25 PM, leveille wrote: > I'm having some issues with the form wizard, that maybe someone can > shed some light on. According to the docstring in the method > process_step: I can "dynamically alter self.form_list". So, based on > my project needs, I'm appending forms to th

Re: Static files in development and deployment

2010-02-01 Thread David De La Harpe Golden
On 01/02/10 14:48, Eugene Wee wrote: This works very well for admin media, uploaded files, and static files referenced from within templates (as I pass MEDIA_URL to the templates), Just in case: note 'django.core.context_processors.media' exists to do that for you. but for static files refe

Re: Select *Latest* Grade Information for every Student

2010-01-28 Thread David
In SQL, this would be (and I'm winging this right now so I might be slightly off) SELECT name, address, `date`, test_name, grade FROM Student as stu LEFT JOIN Grade ON stu.id = Grade.student_id WHERE `date` >= (SELECT max(`date`) FROM Grade WHERE student_id = stu.id) ORDER BY name Unless you

Re: Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2010-01-24 Thread David Ross @ Wolfeon
unless it comes from a mailing list. You harvested the addresses from the django people website and/or the mailing list with the purpose of spamming everyone. On Jan 24, 11:12 am, Eike wrote: > Tim: > > Maybe you are right that I contacted him about working together with > me on Djan

Re: Admin calendar popups on datefield suddenly missing

2010-01-22 Thread David De La Harpe Golden
Walt wrote: > Okay, we're getting somewhere. It can find the JS file(s) just fine The static files maybe. > and I see that the calendars are added dynamically. However, I'm > have found that it is generating a javascript error when the page > loads: > > Error: gettext is not defined Now, I'm wo

Mod Python ImportError

2010-01-19 Thread David
I'm getting an ImportError... I think it's a sys.path problem but I can't figure out what to do. Below are the details. Any help? ## Mod Python Error ## MOD_PYTHON ERROR ProcessId: 17855 Interpreter:'my_django' ServerName: 'cube.twusa.ca' DocumentRoot: '/var/www/html' URI:

Re: problem with multiple database with django 1.1.1 please help

2010-01-19 Thread David De La Harpe Golden
chiranjeevi.muttoju wrote: > Hi friends, > > i am working with django1.1.1, now i want to connect django with > multiple database, could you people please help me how to achieve > this. Django 1.1.1 /does not support/ multiple databases. You therefore cannot expect much in the way of help with 1

Editing ModelForm instance

2010-01-17 Thread David
When editing an object using ModelForm, the best way I know is def my_view(request): obj_id = request.POST.get('obj_id', '') old_object = MyModel.objects.get(pk=obj_id) form = MyModelForm(request.POST, instance=old_object) ... but I'm thinking the first two lines are a pain to wri

Re: Best way to track user presence

2010-01-15 Thread David De La Harpe Golden
E17 wrote: > I wouldn't like to use cron, as running full python execution stack is > quite expensive in terms of performance. For the same reason I don't > like to run this code on [every] request handlers. > > Seems to me like better solution would be to use some outer deamon or > deamon-like p

Migrating Many-To-Many Relationship

2010-01-12 Thread David Nolen
When migrating an existing db how do you create a proper join table for a ManyToMany field. I think I've got it mostly worked out except for the bit that looks like this in Django generated SQL: CREATE TABLE `blog_posts_authors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `post_id` int(11) NOT NUL

Re: Creating multiple related objects to a given QuerySet without evaluating the QuerySet

2010-01-05 Thread David
Alright, thanks Daniel. On Jan 5, 1:12 am, Daniel Roseman wrote: > On Jan 4, 11:40 pm, David wrote: > > > I have a QuerySet of Books, and I want to create an Action for each > > Book in that QuerySet. I want to avoid evaluating the Books QuerySet, > > but the only way I

Creating multiple related objects to a given QuerySet without evaluating the QuerySet

2010-01-04 Thread David
I have a QuerySet of Books, and I want to create an Action for each Book in that QuerySet. I want to avoid evaluating the Books QuerySet, but the only way I can think of doing what I want to do evaluates it. For example, def create_actions(books, action) books is a QuerySet of Book"""

Re: Logout and session

2009-12-21 Thread David De La Harpe Golden
On Mon, Dec 21, 2009 at 12:52:24PM -0200, Victor Loureiro Lima wrote: > Well, template caching invalidates view cache right? Plus, my understanding > of the template cache is that > it will hit my view, do all the DB stuff, but skip the template processing > which takes a while to finish, is my un

Re: Cron vs event triggered action

2009-12-21 Thread David De La Harpe Golden
On Sat, Dec 19, 2009 at 06:28:23AM -0800, Tim Daniel wrote: > David, Celery sounds really good, thanks for the tip, I'll have a > deeper look into it as soon as I've got some time, if I can't get it > one question: Is it capable of running on every web server > that s

Re: Logout and session

2009-12-21 Thread David De La Harpe Golden
On Thu, Dec 17, 2009 at 03:54:02PM -0200, Victor Loureiro Lima wrote: > Okay, let me further explain my problem... > > My website depends heavilly on the caching system, I'm using cache_page to > cache my view ( using memcached backend ), > however I have the "Hello, " on top of every page when

Re: Logout and session

2009-12-17 Thread David De La Harpe Golden
Victor Loureiro Lima wrote:. > auth system is in fact invalidating my current session id cookie, but > afterwards it sets a new session id cookie, why does it do that? > Um. So that anonymous users of your site still have sessions? Django supports "anonymous sessions", sessions and auth are diffe

Re: Understanding of File Upload in Django

2009-12-15 Thread David De La Harpe Golden
sjtirtha wrote: > But what I understand from the documentation is uploading and saving are two > different processes. How can I trigger the saving then? > First, certainly, when a file is uploaded from a client, django puts it somewhere *temporary* initially. You may have conceptualised that as

Re: Cron vs event triggered action

2009-12-15 Thread David De La Harpe Golden
Tim Daniel wrote: > So how can I implement solution B? Is there a posibility to create a > cron on a user action that executes only one time? > > NOTE: I don't want to rely on a thread that should stay alive for two > hours ore more inside the server memory. Well, celery uses a "celeryd" daemon

Re: contributing code legalities

2009-12-14 Thread David De La Harpe Golden
http://www.djangoproject.com/foundation/cla/ -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroup

Re: Passing data from view to template

2009-12-11 Thread David
Cool. Thanks Shawn! On Dec 11, 7:32 pm, Shawn Milochik wrote: > You don't need to transfer this to JavaScript once it's in JSON, which is a > JavaScript object. > > If you're using AJAX, it's dead easy. > > #use this in your view > return HttpResponse(simplejson.dumps(employees), mimetype="appli

Re: Passing data from view to template

2009-12-11 Thread David
Hi Shawn, Thanks so much for your reply. Here is an example. I have a following dictionary in Python employees = { "accounting" : [ // accounting is an array in employees. { "firstName" : "John", // First element "lastN

Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2009-12-11 Thread David Ross @ Wolfeon
you know the person and are near them to ask why they're taking so long to complete the project. Sincerely, David Ross wolfe on Freenode -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Passing data from view to template

2009-12-11 Thread David
hello, This is my first time to work in the Ajax filed. What I need to do is to pass an object from view to a javaScript function in template. The javaScript is Ajax. I have googled online and read some posts about json, ajax, etc, but I am still not quite clear. Can anybody tell me how to do thi

Re: return a dynamically generated image to the user?

2009-12-10 Thread David De La Harpe Golden
Alexander Dutton wrote: > > The alternative would be to stick an Alias in your apache conf (assuming > you're using apache) to serve the files directly from the filesystem. > This solution wouldn't let you perform any authorisation, though. > N.B. There is nowadays the X-SendFile thing, should b

Re: How can child objects inherit data from parents?

2009-12-10 Thread David De La Harpe Golden
bruno desthuilliers wrote: > First point, you have a tree structure. There are a couple ways to > handle trees in a relational model, each has pros and cons. The most > obvious one is the recursive relationship (also known as 'adjacency > list'): > > create table Person( >id integer primary k

Blocking services in django

2009-12-09 Thread David Koblas
I'm trying to get a better understanding of django performance in a production setting. Specifically I've seen notes that say that operations like sending mail will block all production traffic to your server for the duration of the send. That got me thinking about other backend calls, like se

Re: import twice when run test

2009-12-09 Thread David De La Harpe Golden
>> Python treats them as >> two different files, and hence the signal is attached twice. > -> models.signals.post_save.connect(flaggedentry_post_save, > sender=FlaggedEntry) > Or is there likely to be something else we've got wrong > in our app? > Well, just in case - watch out for the dispatch

Re: How to change default template name for django.views.defaults.page_not_found ?

2009-12-08 Thread David De La Harpe Golden
mateusz.szulc wrote: >>From Django Part 3 tutorial: > "The 404 view is also called if Django doesn't find a match after > checking every regular expression in the URLconf." > > The 404 default view in django is defined as: > def page_not_found(request, template_name='404.html'): > > How can I cha

Re: Unique model field and case sensitivity (postgres)

2009-12-07 Thread David De La Harpe Golden
chefsmart wrote: > By the way, right now I'm using a State.objects.get(name__iexact=name) > in clean_name() method in a form subclass to prevent creation of case- > insensitive duplicates. Just wondering if there is a built-in or > better way. > Well, in postgresql itself one can make a case insen

Re: DRY up your Django templates with Showell Markup

2009-12-05 Thread David Martorana
I wrote this rather quickly. It allows you to put a template.showell file in each app folder, and will render the templates on demand if you call "render_showell_to_response(...)". It'll check the last modification time of the .showell files, and re-renders them if they've changed, allowing you t

Re: DRY up your Django templates with Showell Markup

2009-12-04 Thread David Martorana
I don't want to jump on something too quickly, being somewhat unproven, but it's a nice thing to have with GHRML being dead and HAML being Ruby only. I'll keep an eye on this! What plans do you have for future improvement? Dave On Nov 27, 1:08 pm, Steve Howell wrote: > I would like to announce

Re: Sick of defining urls

2009-12-04 Thread David De La Harpe Golden
Todd Blanchard wrote: > > I've solved my urls problem for now (though I'm open to more > elegant solutions) Depends what you're doing, but if what you're doing fits into its "chained views" convention, django-catalyst will also autogen relevant urls for you - http://code.google.com/p/django-cata

Re: How to call this function

2009-12-01 Thread David
Thanks Daniel. I am working in the way just as you said. On Dec 1, 10:21 am, Daniel Roseman wrote: > On Dec 1, 3:53 pm, David wrote: > > > > > > > Hello John and Daniel, thanks for your replies. Let me tell what I > > need in more detai

Re: How to call this function

2009-12-01 Thread David
Hello John and Daniel, thanks for your replies. Let me tell what I need in more details. {% for value in data %} ... {% endfor %} Here "showDomain(...)" is ajax. There are many lines of records on the webpage. If I click a line, then just below this line it shows doma

How to call this function

2009-11-30 Thread David
Hello, In my template file I have {% for value in data %} {% endfor %} "showDomain(...)" is a JavaScript function. I would like this function to be called in each iteration of the for-loop when all_domain == 1. Anybody knows how to call this function? There are no events (click,

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: Best UI for letting users select an item from a large selection of records?

2009-11-27 Thread David De La Harpe Golden
Stodge wrote: > Thanks. I have the DataTables plugin working so I can filter my > records. Now I just need to work out how to select specific ones from > the table and work with them. > Well, that depends a bit on what you want. if you, say, used javascript to directly populate a field in a html

Re: Ordering over ManyToMany relationship omits records

2009-11-26 Thread David
as if the duplicate id "swallowing up" the missing records. I have no clue why though... hope these details help clarify my problem. On Nov 26, 1:31 pm, David wrote: > When I order over a ManyToMany relationship, certain records will not > appear. The record which disappears chan

Ordering over ManyToMany relationship omits records

2009-11-26 Thread David
When I order over a ManyToMany relationship, certain records will not appear. The record which disappears changes depending on the order by which I sort it. Specifically: >>> Listing.objects.order_by("book__courses") gives me Listings with id's (5, 1, 3, 5, 2, 4), and >>> Listing.objects.order_

<    3   4   5   6   7   8   9   10   11   12   >