Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
Could paste your template code here: http://paste.e-scribe.com/ and paste the URL to the paste bin in a message here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
On Nov 3, 8:15 pm, "argh44z" <[EMAIL PROTECTED]> wrote: > I'm thinking about cleaning up the code and open-sourcing it. Is anyone > interested? I ask this because 3 weeks ago when I started working on > it, I didn't really see much forum software written with Django that > was in much actual usage. There were things like Zyons and Myghty, but > I didn't see many sites using them. Sure! The forum project is one I personally most interested. BTW, it's a bit embarrassing that sites like djangoforums.org actually uses PHP forum engine =) -- serg. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
PS the site is main.howcurio.us/blog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
Okay, so I've put in that code and it processes it fine and everything, however, all the entries are being placed in the else section, the filter for counter "1" doesn't seem to be grabbing the latest article. Is there another filter that could maybe grab it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
Bill de hOra wrote: > > http://www.djangoproject.com/documentation/cache/ One other thing; be sure you are only ever issuing the initial cookie with POST request and not a GET. cheers Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
Jakub Labath wrote: > Hi All, > > I have serious problem with my django websites. > I've experienced random user switching. > > User A logs in and user B logs in they both surf the site for a bit > then all of a sudden the user B is now user A. > > So far I tracked it down to the fact that the sessionid cookie would > be the same on user's A computer as well as on user's B computer. > Which of course explains the above behaviour however, I'm not sure how > is this even possible I know the cookies are generated per request why > would it suddenly send the same cookie to two different clients. > > [...] > > I'm not even sure if this is a django problem. > > Anybody experienced something similar? Not in django, but yes with cacheable content that isn't configured to respect state that's held in a cookie. If A and B are sharing session state via cookies as you suggest, you'll need to instruct downstream caches to respect the cookies using a Vary header directive: http://www.djangoproject.com/documentation/cache/ cheers Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Multiple-files model doens't work
Please check multiple model file: models/ __init__.py model_a.py model_b.py in model_x.py set app_label in Meta manually in __init__.py: from model_a import * from model_b import * --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField on admin
I had the same problem. I fixed it by placing a forward slash in front of the image src in the template where I render the page. Seems to work fine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
What's the best way to make a custom publishing workflow?
Hi, I'm pretty new to django, so forgive me if this is an old topic, but... I'd like to make a custom workflow for publishing purposes and have it part of the built-in admin authorization system, without modifying the admin code itself (in case of upgrades, etc.) (So instead of just user->can modify object, I could create user->can set attribute 'publish this now' on object). Is this sort of thing in the development roadmap? If not, what's the generally-accepted best way to implement this sort of thing? My initial thoughts were to create a workflow field in my 'Story' model that wouldn't be shown in the admin interface, except to members of a certain group, but it's kind of a hack, and would involve changing the admin views. Any suggestions? Or am I missing something basic? Thanks! Kevin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Re: OT: MySQL to SQLite?
On 11/4/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > iain duncan wrote: > If I end up helping him more than I'm thinking, I'll try to blog it or > update the Django on Tiger page (which is against 0.91 and assumes > Postgresql). I run OSX at home, running the DarwinPorts tools. Once I found those, gettng starting was relatively straightforward. If someone is looking for some way to contribute, a proper OSX mpkg/dmg with a full Django stack would be a nice starter project. Yours, Russ Magee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Re: OT: MySQL to SQLite?
On 11/4/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > I'm just curious... when the multi-db branch comes in, is this something > where you could have 2 database settings and you could serialize with > data from DB1 and de-serialize to DB2? I'm not sure. I can't say I've had a play with the multi-db branch. However, from what I know of that branch, I suspect you might have some problems because the models from DB1 don't overlap with the models in DB2 (i.e., you don't have a 'User' model in both databases - you have "users" in one and "products" in another.) Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
On 11/4/06, Jakub Labath <[EMAIL PROTECTED]> wrote: > > User A logs in and user B logs in they both surf the site for a bit > then all of a sudden the user B is now user A. Are you using the caching framework, or is there a proxy cache (e.g., squid) between the users and your web site? It sounds to me like you might have a caching problem. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Admin problems when object is created by a view
On 11/4/06, iain duncan <[EMAIL PROTECTED]> wrote: > > If I create a new instance of a database object from a view, this item > appears fine in the database and even in the changelist view of the > admin, but clicking on the item ( as if going to delete or edit it ) > just gets a template error. Anyone know why this is? Looks to me like the view is getting confused (not the template). The view has some logic that looks for the first field on the form, which in your case, doesn't exist - the auto_add_now means that there are no field on the form. Immediate workaround solution - add another field (integer, null=True, blank=True). Wasteful of DB space, yes, but gets around the problem. Real solution - raise a ticket for the problem with your example model and an example error trace. Feel free to spelunk into the admin view code to fix the problem, too :-) Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: heeeellllp! Database woes!
On 11/4/06, Tom Smith <[EMAIL PROTECTED]> wrote: > Any pointers as to how I might track this tricky one down, gratefully > received... Two suggestions: 1) The query might be issued by the manipulators - one of my co-workers is currently tracking a performance problem that seems to be caused when a manipulator on a model with related objects (especiallly o2o fields) is created. 2) One helpful debug tool: from django.db import connection print connection.queries connection.queries is a list of all SQL queries that have been issued, with the time it took to execute them. If you want to see what queries a block of code is issuing, you can manually clear the list, perform some work, then print the list: connection.queries = [] ... do stuff print connection.queries Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Re: Many-to-Many with Intermediate Table
On 11/4/06, yary <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > Django's model syntax already allows ambiguities. I just tried the > above, and Django doesn't complain when you create the model, it does Erm... I'd be interested to know how you tested this, because I get: Error: Couldn't install apps, because there were errors in one or more models: clashtest.modelc: Accessor for field 'relation' clashes with related field 'ModelA.relation'. Add a related_name argument to the definition for 'relation'. clashtest.modelc: Reverse query name for field 'relation' clashes with related field 'ModelA.relation'. Add a related_name argument to the definition for 'relation'. clashtest.modelb: Accessor for field 'relation' clashes with related field 'ModelA.relation'. Add a related_name argument to the definition for 'relation'. clashtest.modelb: Reverse query name for field 'relation' clashes with related field 'ModelA.relation'. Add a related_name argument to the definition for 'relation'. both on syncdb and validate. I've done a lot of work in this area, including writing a fairly complex unit test to check all sorts of obscure model validation conditions - if you've found a bug, I want to kill it. Yours, Russ Magee %-). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
heeeellllp! Database woes!
I have a lovely little django driven database site that is fine except for one thing... ever so occassionaly there is a sql call that goes select * from product Now, I don't call that explicitly... but it does happen... and I have a million products and it kills mysqld... shaboom! Now, i suspect that there is a bug in django, like the one where if you do an "id in [ ] " ... that it may return ALL a tables contents... but I have trapped that... looked at the number of times I query that table etc... and for the life of me cannot work out when or where it happens... I have looked at every single instance of Product.objects.* and not found it... I splat all the sql queries to the screen and this is complicated by the fact that one my local copy it doesn't happen, and on the server it does... and yes I've been through many iterations of what are the differences between the server and my local copy, mysql version? django version? what? I am completely lost... Django is issuing a sql cal I know I don't ever make... and I suspect it sql generation gone wrong Any pointers as to how I might track this tricky one down, gratefully received... tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Admin problems when object is created by a view
If I create a new instance of a database object from a view, this item appears fine in the database and even in the changelist view of the admin, but clicking on the item ( as if going to delete or edit it ) just gets a template error. Anyone know why this is? Ie in the the view method we have hit = Hit() save.hit() And in the model: class Hit( models.Model ): date_time = models.DateTimeField( auto_now_add="True" ) class Admin: pass The hits appear as a list in the admin but can't be clicked on. Thanks Iain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
On Nov 3, 2:35 pm, "Jakub Labath" <[EMAIL PROTECTED]> wrote: > Hi argh44z, > > But did you have the same problem? Was the same sessionid sent to > different clients? Yes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
On Nov 3, 2:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Sure.. send it out. I am using a version of Myghty, at least in > testing.http://gretschpages.com/forum/ Very cool design. > but I love seeing how other folks do things. > > There oughta be some sort of django forum group that could take the > good work from Zyons, Myghty and this one, merge the best ideas, and > build a single killer Django forum. Yup, that'd be awesome. I was mainly going for a forum that resembled punbb. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
On Nov 3, 2:26 pm, "yun" <[EMAIL PROTECTED]> wrote: > As I'm relatively new to Django (I'm still reading through tutorials > and documentation), I was wondering how you managed user > authentication. I know that it can be managed throught the auth > package, but I was curious how you specifically handled it because I > think it was pretty neat. I'm using the auth package, but not the auth generic views. I made a user profile model which has a one to one relationship with an auth.user object, and contains extra information that a forum would need. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
On Nov 3, 3:58 pm, "Andy" <[EMAIL PROTECTED]> wrote: > Do I need to include {% for object in latest %}? Or, does this replace > it? You need to include it: {% for object in latest %} {% ifequal forloop.counter "1" %} -- Insert code here to render the first blog entry --- {% else %} -- code for the rest of the blog entries --- {% endifequal %} {% endfor %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
Me? Yeah. It's a variation on Piotr's Myghtyboard, tweaked for my needs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
Do I need to include {% for object in latest %}? Or, does this replace it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: OT: MySQL to SQLite?
iain duncan wrote: > I would honestly say it will take much less time for him to get mysql > running on the laptop ( which is simple with fink ) than to figure out a > nice porting system. You're right. I was making the assumption that SQLite and pysqlite would be an easier install process for him. Looking around, there are some outdated Mac/Django install guides out there. I've done it twice and didn't have trouble, but I'm a Linux geek (and Fink was one of the first things I installed on my Mac). But trying to help someone else easily install a development environment for Django shows me this is a documentation need. If I end up helping him more than I'm thinking, I'll try to blog it or update the Django on Tiger page (which is against 0.91 and assumes Postgresql). -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bizarre form-mail thing
When python expects a list and gets a string, it treats each character of the string as an item in the list. If you look at the first character of each email address in the TO field, you will notice that it spells out your email address. Perhaps this will make it more clear: >>> s = 'string' >>> for item in s: ...print item s t r i n g >>> L = ['a', 'list', 'of', 'strings'] >>> for item in L: ...print item a list of strings >>> l = ['a list of one string'] >>> for item in l: ...print item a list of one string Therefore, there is no easy way to tell of you are only passing in one item or multiple. For that reason, the code was written to expect a list, even if that list only contains one item. We certainly wouldn't want to limit one from sending an email to only one recipient at a time, so a list is expected in this case. Now you know why and how to detect the problem next time. On 11/3/06, patrickk <[EMAIL PROTECTED]> wrote: > > see http://www.djangoproject.com/documentation/email/ > look at the "quick example" ... > > patrick > > Am 03.11.2006 um 21:04 schrieb [EMAIL PROTECTED]: > > > > > Not following you Patrick. Why does 'to' have to be a list? I've got a > > single-recipient thing here. > > > > > > > > > > > > -- Waylan Limberg [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.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RE: So I made a forum with Django
Are you developing that forum w/ django? regards, Jason == Jason Wydro project engineer w3developing toll free: (800) 615-6493 local: (971) 732-5055 fax: (971) 223-3668 mobile-mail: [EMAIL PROTECTED] email: [EMAIL PROTECTED] web: www.w3developing.com == -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, November 03, 2006 12:38 PM To: Django users Subject: Re: So I made a forum with Django Sure.. send it out. I am using a version of Myghty, at least in testing. http://gretschpages.com/forum/ but I love seeing how other folks do things. There oughta be some sort of django forum group that could take the good work from Zyons, Myghty and this one, merge the best ideas, and build a single killer Django forum. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
custom forms
Hello! I'm trying to reimplement legacy PHP-based app with django The most interesting part is some sort of "registration" It looks like: * step1: user enter some information in form * step2: app return next form where some select's choices "based" on values from step1 * step3: app shows conformation page with entered values + some others based on that values ( description value) app doesn't uses database directly, instead it has xml based http gateway to work with database so, i can't use django models, right? step1/2 have a lot of input elements, so i don't want to hardcode forms in templates, but i need a way to add "comment" entries in the middle of the form What should i use to easy generating forms, validate and save values in django way? i saw newforms module in sources (i use latest checkout), should i use it? and do validation in view on POST? or if it will be better to use custom manipulator? I need a hint how this should dbe implemented in django way btw, it seems that i can't store fields description in Form or field classes? -- Pavel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
Sure.. send it out. I am using a version of Myghty, at least in testing. http://gretschpages.com/forum/ but I love seeing how other folks do things. There oughta be some sort of django forum group that could take the good work from Zyons, Myghty and this one, merge the best ideas, and build a single killer Django forum. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
Hi argh44z, But did you have the same problem? Was the same sessionid sent to different clients? Thanks for help On 11/3/06, argh44z <[EMAIL PROTECTED]> wrote: > > On Nov 3, 12:26 pm, "argh44z" <[EMAIL PROTECTED]> wrote: > > On Nov 3, 10:23 am, "Jakub Labath" <[EMAIL PROTECTED]> wrote: > > > > > Hi All > > BTW, I'm using a completely different envionment than you. lighttpd > with preforked > fastcgi processes. > > > > > -- Jakub Labath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bizarre form-mail thing
Ah gracias. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
On Nov 4, 2006, at 2:15 AM, argh44z wrote: > > Here: http://huzzah.cc/ > > I'm thinking about cleaning up the code and open-sourcing it. Is > anyone > interested? I ask this because 3 weeks ago when I started working on > it, I didn't really see much forum software written with Django that > was in much actual usage. There were things like Zyons and Myghty, but > I didn't see many sites using them. > > I'm very impressed with Django btw. I hadn't heard of Django 4 weeks > ago, picked it up, very easy to learn and use, and quite powerful. Another happy Django story. :-) +1! Looking forward to. -Cheng Zhang Gentoo/Python/Django Powered http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django/db/models/base.py:383: Local variable (rel) not used
Hello Russell, On Fri, Nov 03, 2006 at 10:26:23AM +0800, Russell Keith-Magee wrote: > Thanks for the report. Apologies for the behaviour of the spam filter; > we've been having some difficulties with it lately. > > Its true - rel isn't used. But neither is the rest of the method. The > _set method in question is a fossilized remnant of v0.91 (pre-magic > removal). I've removed it in r3963. Thanks! With kind regards, Baurzhan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
As I'm relatively new to Django (I'm still reading through tutorials and documentation), I was wondering how you managed user authentication. I know that it can be managed throught the auth package, but I was curious how you specifically handled it because I think it was pretty neat. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bizarre form-mail thing
see http://www.djangoproject.com/documentation/email/ look at the "quick example" ... patrick Am 03.11.2006 um 21:04 schrieb [EMAIL PROTECTED]: > > Not following you Patrick. Why does 'to' have to be a list? I've got a > single-recipient thing here. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bizarre form-mail thing
Not following you Patrick. Why does 'to' have to be a list? I've got a single-recipient thing here. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: So I made a forum with Django
On Nov 3, 1:15 pm, "argh44z" <[EMAIL PROTECTED]> wrote: > Here:http://huzzah.cc/ > > I'm thinking about cleaning up the code and open-sourcing it. Is anyone > interested? Sure we are. Can't have too many Django apps. I ask this because 3 weeks ago when I started working on > it, I didn't really see much forum software written with Django that > was in much actual usage. There were things like Zyons and Myghty, but > I didn't see many sites using them. > > I'm very impressed with Django btw. I hadn't heard of Django 4 weeks > ago, picked it up, very easy to learn and use, and quite powerful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bizarre form-mail thing
"to" has to be a list: ['[EMAIL PROTECTED]'] patrick Am 03.11.2006 um 20:08 schrieb [EMAIL PROTECTED]: > > So, I've got a contact form so people can email me, or, if a username > is passed in the URL, site members can email each other. It works > fine, > at least so far as I can tell. People get the emails, in other words. > > The weirdness is in the "TO:" fields the recipient sees: They look > something like this: > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; "."@ruble.dreamhost.com; [EMAIL PROTECTED]; > [EMAIL PROTECTED]; "."@ruble.dreamhost.com; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Gretsch Pages contact form message > > The flaky part is that the recipient ISN'T in there, but they get it. > > Here's the view: > > from django.core import mail, validators > from django import forms > from django.http import HttpResponseRedirect > from django.shortcuts import render_to_response > from pprint import pformat > from urllib import urlencode > from django.contrib.auth.models import User > > class ContactManipulator(forms.Manipulator): > def __init__(self): > self.fields = [ > forms.TextField('name', is_required=True), > forms.EmailField('from_address', is_required=True), > forms.LargeTextField('message', is_required=True), > ] > > def save(self, new_data, to): > mail.send_mail("Gretsch Pages contact form message", >new_data["message"], >new_data["from_address"], >str(to), >fail_silently = False > ) > > return "done/" > > def contact(request, slug=""): > if slug=="": > to = "[EMAIL PROTECTED]" > else: > to = User.objects.get(username=slug).email > return form_helper(request, to, ContactManipulator(), > "contact/form.html") > > > def form_helper(request, to, manipulator, template): > if request.POST: > new_data = request.POST.copy() > errors = manipulator.get_validation_errors(new_data) > if not errors: > manipulator.do_html2python(new_data) > redirect_url = manipulator.save(new_data, to) > return HttpResponseRedirect(redirect_url) > else: > errors = new_data = {} > context = {'form' : forms.FormWrapper(manipulator, new_data, > errors)} > return render_to_response(template, context) > > Any ideas? > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Bizarre form-mail thing
So, I've got a contact form so people can email me, or, if a username is passed in the URL, site members can email each other. It works fine, at least so far as I can tell. People get the emails, in other words. The weirdness is in the "TO:" fields the recipient sees: They look something like this: To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; "."@ruble.dreamhost.com; [EMAIL PROTECTED]; [EMAIL PROTECTED]; "."@ruble.dreamhost.com; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Gretsch Pages contact form message The flaky part is that the recipient ISN'T in there, but they get it. Here's the view: from django.core import mail, validators from django import forms from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from pprint import pformat from urllib import urlencode from django.contrib.auth.models import User class ContactManipulator(forms.Manipulator): def __init__(self): self.fields = [ forms.TextField('name', is_required=True), forms.EmailField('from_address', is_required=True), forms.LargeTextField('message', is_required=True), ] def save(self, new_data, to): mail.send_mail("Gretsch Pages contact form message", new_data["message"], new_data["from_address"], str(to), fail_silently = False ) return "done/" def contact(request, slug=""): if slug=="": to = "[EMAIL PROTECTED]" else: to = User.objects.get(username=slug).email return form_helper(request, to, ContactManipulator(), "contact/form.html") def form_helper(request, to, manipulator, template): if request.POST: new_data = request.POST.copy() errors = manipulator.get_validation_errors(new_data) if not errors: manipulator.do_html2python(new_data) redirect_url = manipulator.save(new_data, to) return HttpResponseRedirect(redirect_url) else: errors = new_data = {} context = {'form' : forms.FormWrapper(manipulator, new_data, errors)} return render_to_response(template, context) Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: OT: MySQL to SQLite?
I do this kind of thing a lot, and find it's much much easier to have MySQL on both machines and use mysqldump. A big advantage of two mysql specific installs is that you can use mysqldump with the field name option and it will still work fine even if you are changing models. I write little bash scripts that dump everything, drop the tables, call manage.py syncdb to create the new tables, and then refill the tables. I would honestly say it will take much less time for him to get mysql running on the laptop ( which is simple with fink ) than to figure out a nice porting system. Iain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is Django the right tool for the job?
On Fri, 2006-03-11 at 13:17 +, elake wrote: > Thanks. Thats what I thought. I think that we are going to put up a > site that is all from a WYSIWYG and in the background I am going to > work on a Django powered site. Would you recommend Postgres over MySQL > or the other way around? I think that is a wise choice. You could use something static or do a Drupal install, and then you won't be trying to learn Django under deadline. If I can't get a client to bite for a custom CMS in Django, Drupal is the off-the-shelf cheap solution I recommend because it is at least well documented, cleanly coded ( though in PHP ) and easy to install and maintain. Sometimes a client is determined to muck around with the CMS themselves and I can trust them more with Drupal than with Django code. ( It's dead easy to break a django site if you don't know what you're doing! ) Django makes web dev much much faster, but does not really make it *easier* for a beginner, in that you do have to understand and wrap your head around a fair bit of coding to get it going. For an experienced coder on the other hand, it makes building a complex CMS far easier. For what you are doing I don't think it will matter which RDBMS you use. I personally use MySQL because I never do anything complicated with a database ( where Postgres would shine ) and MySQL is IMHO better documented for the beginner and more widely available on cheap hosting. Django will talk to both just fine so go with whatever looks easiest to get up and running. You may even want to use SQLite to lower hosting costs. Hope that is useful, Iain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Please whitelist me!!!
On 11/3/06, Iker Jimenez <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to submit a new ticket for a bug but I always get an " > Akismet rejected spam" response. Can you please whitelist me??? > > Thanks. > see this message: http://groups.google.com/group/django-developers/browse_thread/thread/73adcd35547d150 -- Waylan Limberg [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.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Can't get Apache + mod_python + sqlite3 to work
Thank you very much, Bryan. I tried chmod -R 777 on everything and I still get the same error message. On Oct 28, 9:44 am, "Bryan Murdock" <[EMAIL PROTECTED]> wrote: > One thing I noticed when I set up sqlite was that the apache user had > to have full permissions on both the database file and the directory > where the file was contained. I don't remember the exact errors I got > back when I had that problem, but figured I'd throw out my experience. > > Bryan > > On 10/26/06, 735115 <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I've been able to get a Django app on Linux running using the built-in > > development server by running: > > > # python manage.py runserver > > > However, I've been trying for hours now trying to set up Apache + > > mod_python, but I keep getting the same "SystemError: NULL result > > without error in PyObject_Call" error from Django's sqlite3 backend. > > Here's my configuration: > > > Django 0.95 > > sqlite 3.3.8 > > pysqlite 2.3.2 > > Apache 2.0.53 > > Python 2.3.4 > > Fedora Core 3 > > > This is how I set up my Apache .conf file: > > > Alias /dj /home/bh/web/django > > > > SetHandler python-program > > PythonHandler django.core.handlers.modpython > > SetEnv DJANGO_SETTINGS_MODULE myapp.settings > > PythonDebug On > > PythonPath "['/home/bh/web/django'] + sys.path" > > > > > Accessing my /dj directory from Firefox, I get this error message: > > > === > > > Mod_python error: "PythonHandler django.core.handlers.modpython" > > > Traceback (most recent call last): > > > File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line > > 299, in HandlerDispatch > > result = object(req) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/handlers/modpython.py", > > line 163, in handler > > return ModPythonHandler()(req) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/core/handlers/modpython.py", > > line 140, in __call__ > > response = middleware_method(request, response) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/contrib/sessions/middleware.py", > > line 81, in process_response > > session_key = request.session.session_key or > > Session.objects.get_new_session_key() > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/contrib/sessions/models.py", > > line 21, in get_new_session_key > > self.get(session_key=session_key) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/models/manager.py", > > line 67, in get > > return self.get_query_set().get(*args, **kwargs) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/models/query.py", > > line 211, in get > > obj_list = list(clone) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/models/query.py", > > line 103, in __iter__ > > return iter(self._get_data()) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/models/query.py", > > line 430, in _get_data > > self._result_cache = list(self.iterator()) > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/models/query.py", > > line 170, in iterator > > cursor = connection.cursor() > > > File > > "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/db/backends/sqlite3/base.py", > > line 45, in cursor > > detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES) > > > SystemError: NULL result without error in PyObject_Call > > > === > > > I am totally lost and could not find any similar problems anywhere on > > the web. Any pointers? Please let me know if I should clarify anything. > > > Thanks in advance, > >Bryant --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
On Nov 3, 10:23 am, "Jakub Labath" <[EMAIL PROTECTED]> wrote: > Hi All, > > I have serious problem with my django websites. > I've experienced random user switching. I experienced this on my site. I figured it was some sort of weird race condition since it only happened every once in a while. I worked around it by storing the current ip of the user into the session in the login view. Then I made some custom middleware with a process_view function, which if a user is logged in, checked the ip from the session with the request's ip. If not, i'd log the user out. Since it only happened every once in a while, users weren't bothered. Then, I discovered that it did bother some users of certain ISP's (AOL), where the IP changed quite often. So, I disabled this custom middleware. The problem reappeared. I then put back the middleware, but made both branches passthrough. The problem hasn't reappeared ever since. Just doing that must disable the race condition. It's weird. I don't know. What I use now: class testmw(object): def process_view(self, request, view_func, view_args, view_kwargs): if view_func != huzzah.forum.views.login: if request.session.get('LOGGED_IN_IP','')[:5] != request.META['REMOTE_ADDR'][:5]: return None return None --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Session problems
On Nov 3, 12:26 pm, "argh44z" <[EMAIL PROTECTED]> wrote: > On Nov 3, 10:23 am, "Jakub Labath" <[EMAIL PROTECTED]> wrote: > > > Hi All BTW, I'm using a completely different envionment than you. lighttpd with preforked fastcgi processes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
So I made a forum with Django
Here: http://huzzah.cc/ I'm thinking about cleaning up the code and open-sourcing it. Is anyone interested? I ask this because 3 weeks ago when I started working on it, I didn't really see much forum software written with Django that was in much actual usage. There were things like Zyons and Myghty, but I didn't see many sites using them. I'm very impressed with Django btw. I hadn't heard of Django 4 weeks ago, picked it up, very easy to learn and use, and quite powerful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Many-to-Many with Intermediate Table
Russell Keith-Magee wrote: > On 11/3/06, yary <[EMAIL PROTECTED]> wrote: > > > > The idea here is that adding a 'realation_model' option to ManyToMany > > This idea has been suggested previously, and has been rejected > previously - it has some problems when you hit queries. > > > All queries seem pretty straightforward. > > In your example, yes. However, as always, the devil is in the detail. > Consider: > > class ModelA(Model): >name = CharField(...) > > class Relation(Model): >name = CharField(...) > > class ModelB(Model): >name = CharField(...) >relation = ManyToManyField(ModelA, relation_model=Relation) > > What is the meaning of: > > ModelA.objects.filter(relation__name='foo') > > Does this query reference the name of the Relation model, or of ModelB? > > This is an artificial example, but it represents the crux of the > problem - there is no easy way to integrate queries over the > intermediate table without introducing ambiguities in queries over the > related table. I see your ambiguity, and raise you one: class ModelA(Model): name = CharField(maxlength=40) class ModelB(Model): name = CharField(maxlength=40) relation = ForeignKey(ModelA, related_name='relation') class ModelC(Model): name = CharField(maxlength=40) relation = ForeignKey(ModelA, related_name='relation') What is the meaning of: ModelA.objects.filter(relation__name='foo') ? Django's model syntax already allows ambiguities. I just tried the above, and Django doesn't complain when you create the model, it does when you try to use the filter. Which leads me to think of five possible solutions: 0. Remind people that the convention for both ForeignKey and ManyToManyFields is to use the name of the foreign model when building the field name. The contrived example is ambiguous because it defies that practice and uses the relation name instead. Problem solved by cultural norm. 1. Current solution, as "the way it is in 0.95": allow ambiguities, if the app writer contrives a painful model, they live with the pain and can't use the masked attribute. Problem solved by loud complaining late in the game. 2. Open a ticket to have Django warn about ambiguous models at syncdb time, so model creator will know to rename attributes/set up distinctive "related_name". Problem solved by gentle prodding early in game. The last two aren't serious, but they'd fix it too: 3. Always require programmer to specify which model they want when traversing a join. Problem solved by excessive verbosity. 4. Drop relations from the Django DB model altogether. Problem solved by excessive pedanticness. Summing it up: ambiguity exists now, and it hasn't stopped Django from providing very useful features. Fixing ambiguity is a related but separate issue. To fix that, I'd vote for #2 (and only warn, because there could be ambiguity in existing apps that work now, because they never tickle the overloaded filters). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Please whitelist me!!!
Hi, I'm trying to submit a new ticket for a bug but I always get an " Akismet rejected spam" response. Can you please whitelist me???Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
setting and using an object variable without using a field
To be able to control a template output based on a current remote address, I created this model. class Poll(models.Model): question = models.CharField('vraag', maxlength=200) pub_date = models.DateTimeField('publicatie datum') voted_by_remote_addr = False def set_voted_by_remote_addr(self, ip): if (self.vote_set.filter(voter_ip = ip).count() > 0): self.voted_by_remote_addr = True I use the model in a view like this: def list(request): poll_list = Poll.objects.all().order_by('-pub_date') for poll in poll_list: poll.set_voted_by_remote_addr(request.META["REMOTE_ADDR"]) return render_to_response('polls_list.html', { 'object_list': poll_list, 'title': 'List of polls', }, context_instance=RequestContext(request)) The template contains: {% if object_list %} {% for poll in object_list %} {{ poll.question }} {{ poll.voted_by_remote_addr }} {% endfor %} {% else %} No polls are available. {% endif %} And. it's working. Just one question: Is this the right way to do such things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: OT: MySQL to SQLite?
How about using SQL? On a *nix machine, you'd use mysqldump to output the db in sql format, then use the ".read" command in sqlite to read it in. For the reverse journey from sqlite to mysql, it would be the ".output"/".dump" commands to create the sql file, and the "source" command in mysql to read it back in. Rachel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: OT: MySQL to SQLite?
Rachel Willmer wrote: > How about using SQL? > > On a *nix machine, you'd use mysqldump to output the db in sql format, > then use the ".read" command in sqlite to read it in. > > For the reverse journey from sqlite to mysql, it would be the > ".output"/".dump" commands to create the sql file, and the "source" > command in mysql to read it back in. I know MySQL and SQLite define their fields differently. But you're right... I could use Django to create the db and tables, then just dump the data from mysql and import it into sqlite. For practicality, this is probably the way to go. For helping test Django and learning, playing with serialization sounds fun. :) Thanks, Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: jquery integration to django?
On 11/3/06, Enquest <[EMAIL PROTECTED]> wrote: > What would it take to integrate jquery to Django? > Just like now is happening with Dojo... I think however jquery is a > better lib ... Dojo integration was a fleeting, now-discarded idea. Django will not be "integrating" any JS toolkit. One good reason for this is evident in your post: no matter which one was chosen, someone would always be thinking that some other toolkit would have been better. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating one call for most recent entry, and another call for the restI have just set up a blog using the helpful tutorial over at
> I want to > style the first post in a completely different manner than the rest. Is > there a simple way to do this? Try this inside the for loop in your template: {% ifequal forloop.counter "1" %} -- Insert code here to render the first blog entry --- {% else %} -- code for the rest of the blog entries --- {% endifequal %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: OT: MySQL to SQLite?
Russell Keith-Magee wrote: > The serializer modeltests is probably your best bet if you are looking > for examples. However, it's a pretty straightforward interface - > > for obj in serializers.deserialize("python", data): > obj.save() I'm just curious... when the multi-db branch comes in, is this something where you could have 2 database settings and you could serialize with data from DB1 and de-serialize to DB2? I can't think of a reason why you'd want to do something like that in a production environment but for what I'm after it would be kinda cool. -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Session problems
Hi All, I have serious problem with my django websites. I've experienced random user switching. User A logs in and user B logs in they both surf the site for a bit then all of a sudden the user B is now user A. So far I tracked it down to the fact that the sessionid cookie would be the same on user's A computer as well as on user's B computer. Which of course explains the above behaviour however, I'm not sure how is this even possible I know the cookies are generated per request why would it suddenly send the same cookie to two different clients. I will keep researching. I'm using apache/and mod-python on debian sarge and I'm experiencing the problem on old as well as on current django development version. Other weird thing is that the problem manifested itself only recently on sites that were OK for six months. The best I can figure is that there is a correlation between the frequency of the problem and a server load. I'm not even sure if this is a django problem. Anybody experienced something similar? -- Jakub Labath --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ImageField on admin
> > while the admin section links me > to:http://10.0.0.5:8000/mockups/2006/10/08/image.png > > ie, it skips 'site_media' in the URL. > Where exactly in the Admin do you see this incorrect link? And what does your entire Image class look like (i.e. does it have a get_absolute_url method, what's defined in the inner class Admin?) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Forms trouble: Extra object ID appended to form action URLs
Besides, what Waylan asked you to test, can you also post here your project's main urls.py? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Forms trouble: Extra object ID appended to form action URLs
On 11/3/06, jefurii <[EMAIL PROTECTED]> wrote: > > Thanks for replying. The update method looks like this: > > def update(request, myobject_id): > o = get_object_or_404(MyObject, pk=myobject_id) > o.title = request.POST['name'] > ... > o.save() > return HttpResponseRedirect('/myapp/%s/' % myobject.id) > > The redirect would break, since it goes to the site root right now, but > I've never actually gotten that far yet. As far as I can tell, the > update method is never called because the request never gets past the > 404. > My guess is that your use of get_object_or_404 is covering the real error. Try commenting out that line and accessing your object directly ( I'm guessing something like this: o=MyObject.objects.get(pk=object_id) ) and see what errors you get. That should give you (and us) a hint of where to look. -- Waylan Limberg [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.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Forms trouble: Extra object ID appended to form action URLs
Thanks for replying. The update method looks like this: def update(request, myobject_id): o = get_object_or_404(MyObject, pk=myobject_id) o.title = request.POST['name'] ... o.save() return HttpResponseRedirect('/myapp/%s/' % myobject.id) The redirect would break, since it goes to the site root right now, but I've never actually gotten that far yet. As far as I can tell, the update method is never called because the request never gets past the 404. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Creating a decoration for the views
I think that a context processor is better suited for this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ImageField on admin
Defined a simple Image model: class Image(models.Model): image = models.ImageField(upload_to='mockups/%Y/%m/%d') settings.py: MEDIA_ROOT = '/home/panos/web-projects/media/panosart/' MEDIA_URL = 'http://10.0.0.5:8000/site_media/' urls.py: (r^site_media/(?P.*)$', django.views.static.serve', {'document_root': '/home/panos/web-projects/media/panosart', 'show_indexes': True}), The problem is this: When I upload an image from the admin section it uploads fine *but*, the actual url path is: http://10.0.0.5:8000/site_media/mockups/2006/10/08/image.png while the admin section links me to: http://10.0.0.5:8000/mockups/2006/10/08/image.png ie, it skips 'site_media' in the URL. Is there any way to fix this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Lighttpd log timestamp
It's more of a Lighttpd issue, (I've Googled, posted to the Lighttpd wiki and e-mailed and heard nothing back ... ) but I'm serving Django with the Lighttpd/flup/FastCGI combo which works fine. The problem is I can't get the proper time zone to show up in the access logs. The timestamps are GMT and I need Pacific time in order to sync the hits with our Apache logs (which are PT, as they should be). I've tried the formatting examples in the Lighttpd mod_access docs and no joy. Anybody out there successfully moved their Lighttpd logs off of GMT? If so, how'dya do it? Regards, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: jquery integration to django?
I didn't even do that much. I just called the JS in my template head and went about my business. On the sortable tables example, that's all you'd do... add your script tag and it'll take care of it. Of course, Django will output zebra-striped tables for you pretty easily, too. About the only time I actually had to interact with Django was on my stab at ajax, and even then it was just a matter of returning a different response if it was a xmlhttprequest. Trivial. And let me just say again that I REALLY like the Django philosophy of NOT trying to any toolbox, letting the developer use what they want to use, when and how they want to use it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Forms trouble: Extra object ID appended to form action URLs
> > urlpatterns = patterns('myproject.myapp.views', > (r'^$', 'index'), > (r'^(?P\d+)/$', 'detail'), > (r'^(?P\d+)/edit/$', 'edit'), > (r'^(?P\d+)/update/$', 'update'), > ) What does the update method in your views look like? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: wrong hashed pw for web admin interface
Thanks a Lot Gullermo! solved. P. 2006/11/3, Guillermo Fernandez Castellanos <[EMAIL PROTECTED]>: > > It seems to me that you might have created the user but you did not > give him the privileges to enter the admin interface. > > Enter the admin with your... admin user :-) > Go to Users, select the user and check the 'Is staff' option to allow > him to enter the admin site. Then, logout and try to enter with the > new user. It should work then. > > I actually made this mistake several times, having enabled the user to > enter the site, but not the admin app. > > Hope it helps, > > G > > On 11/3/06, Picio <[EMAIL PROTECTED]> wrote: > > > > Hello gys, > > I'm probably falling again and again in some pitfall... > > I want to add a new user with permission in the web admin interface. > > I have fired this script on my command line to have the right hashed pw. > > > > -> http://code.djangoproject.com/wiki/AdminApplication > > > > Then I went to the admin interface, create the user, add permissions > > and PASTED the generated pw. > > > > Trying to log in with the new password I got again the error stating > > that my pw is not right. > > Where I'm wrong? > > > > thx > > Picio > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: jquery integration to django?
It depends on what you mean by integrate ... I'm currently developping a Django/JQuery app and it is desperately easy. All you have to use on a django side is something like this: from django.utils.simplejson import dumps def myView(request): myQuerySet = myFunctionToBuildMyQuerySet(request.POST.copy()) json = dumps(myQuerySet) return HttpResponse(json) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
jquery integration to django?
What would it take to integrate jquery to Django? Just like now is happening with Dojo... I think however jquery is a better lib ... Just look at the following example http://jquery.com/blog/2006/10/18/zebra-table-showdown/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is Django the right tool for the job?
Thanks. Thats what I thought. I think that we are going to put up a site that is all from a WYSIWYG and in the background I am going to work on a Django powered site. Would you recommend Postgres over MySQL or the other way around? On Nov 2, 11:21 pm, iain duncan <[EMAIL PROTECTED]> wrote: > > I am working with a small team to create a new web site for our > > church. > > We have found a site (http://www.prestonwood.org) that we would like > > to > > use as a model and I am wondering if django is the right tool for the > > job. I looked at other django powered sites (http://www.ljworld.com/, > >http://www.lawrence.com/) and they have some of the same features. > > What > > I am wanting to do is give login access to the pastors and other > > leaders to update the pages that go with their ministries. > > > OK, so now to the questions (assuming that django is the right tool to > > use). > > > 1. Would it be best to do this all as one app or a separate app for > > each page? > > 2. Should there be one database instance or multiple (one for each > > page/app)? > > 3. Is the admin page the tool to use for the posters to use to update > > the site?Django is definitely great for that kind of project, as long as > > you are > expecting to write python code and not just plug stuff in. If you are > weighing it against an off the shelf CMS like Drupal, it may or may not > be the best solution. If you were planning on doing any degree of coding > and customization yourself, then I'd say it's worth the effort to learn > Django. > > As to the answers: > - one app and one database will be fine and probably easiest for you to > do while learning > - yes, it's very easy to add accounts to the admin interface that have > limited privileges. > > Iain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Re: Many-to-Many with Intermediate Table
On 11/3/06, yary <[EMAIL PROTECTED]> wrote: > > The idea here is that adding a 'realation_model' option to ManyToMany This idea has been suggested previously, and has been rejected previously - it has some problems when you hit queries. > All queries seem pretty straightforward. In your example, yes. However, as always, the devil is in the detail. Consider: class ModelA(Model): name = CharField(...) class Relation(Model): name = CharField(...) class ModelB(Model): name = CharField(...) relation = ManyToManyField(ModelA, relation_model=Relation) What is the meaning of: ModelA.objects.filter(relation__name='foo') Does this query reference the name of the Relation model, or of ModelB? This is an artificial example, but it represents the crux of the problem - there is no easy way to integrate queries over the intermediate table without introducing ambiguities in queries over the related table. Come up with a clean syntax that differentiates the two, and we have a winner. So far, I haven't seen a viable option. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: wrong hashed pw for web admin interface
It seems to me that you might have created the user but you did not give him the privileges to enter the admin interface. Enter the admin with your... admin user :-) Go to Users, select the user and check the 'Is staff' option to allow him to enter the admin site. Then, logout and try to enter with the new user. It should work then. I actually made this mistake several times, having enabled the user to enter the site, but not the admin app. Hope it helps, G On 11/3/06, Picio <[EMAIL PROTECTED]> wrote: > > Hello gys, > I'm probably falling again and again in some pitfall... > I want to add a new user with permission in the web admin interface. > I have fired this script on my command line to have the right hashed pw. > > -> http://code.djangoproject.com/wiki/AdminApplication > > Then I went to the admin interface, create the user, add permissions > and PASTED the generated pw. > > Trying to log in with the new password I got again the error stating > that my pw is not right. > Where I'm wrong? > > thx > Picio > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
wrong hashed pw for web admin interface
Hello gys, I'm probably falling again and again in some pitfall... I want to add a new user with permission in the web admin interface. I have fired this script on my command line to have the right hashed pw. -> http://code.djangoproject.com/wiki/AdminApplication Then I went to the admin interface, create the user, add permissions and PASTED the generated pw. Trying to log in with the new password I got again the error stating that my pw is not right. Where I'm wrong? thx Picio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Many-to-Many with Intermediate Table
I cannot find any drawbacks in it right now ... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Full table fetches behind the scenes
Andres Luga wrote: > I've set up MySQL to log all queries to the database. In Django I'm > using generic views. I have the following models/tables: > 1. Firm > 2. Person ( ForeignKey( Firm )) I suppose you are using a generic view from 'create_update' package that deals with forms for object? Those generic views construct a manipulator for presenting a form and in this manipulators ForeignKeys are rendered as s by default. And these queries you see select data to fill those s. To fight the problem you can add 'editable=False' to your ForeignKeys definitions so manipulators won't touch them. Another way is to use parameter 'raw_id_admin=True' in ForeignKeys. This way they will be visible in forms not as s but as simple taking IDs of referenced records. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Full table fetches behind the scenes
Hi, I have a problem - when creating an object, Django performs full table SELECT from multiple tables and multiple times. Why? I've set up MySQL to log all queries to the database. In Django I'm using generic views. I have the following models/tables: 1. Firm 2. Person ( ForeignKey( Firm )) 3. PassageRoll( ForeignKey( Firm )) 4. Passage ( ForeignKey( Person ) and ForeignKey( PassageRoll )) 5. Some helper tables I'm creating the new PassageRoll, the relevant URL is set up like this: (r'^firms/(?P\d+)/passroll/create/', '[...].passroll_create', {'model': PassageRoll, 'post_save_redirect': '../..', 'login_required':'True',}), The GET-part of the view is empty - I'm calling generic Create. After the form of the PassageRoll is displayed, the MySQL logfile shows that the following queries were executed: SELECT FIRM (*) SELECT PERSON(*) - 4 times [...] SELECT `django_session`.`session_key`,. SELECT `auth_user`.`id`,... SELECT FIRM (*) SELECT PERSON(*) - 4 times [...] SELECT `auth_message`.`id` Any ideas what might be wrong? How to find the place in blame? Regards, Andres --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---