Re: html to a database.

2010-02-07 Thread JIffin Joy Akkarappatty
Hi, I'm not sure but pls check it out the following links 1. http://www.mercurytide.co.uk/news/article/django-full-text-search/ 2. http://pkarl.com/articles/guide-django-full-text-search-sphinx-and-django-sp/ Thanks & Regards, Jiffin Joy Akkarappatty. On Mon, Feb 8, 2010 at 7:37

Creating an external url in the django admin section

2010-02-07 Thread djangonoob
Hi all. If someone could please help me as I am very new to django and getting desperate for help. The issue is as follows: For one of my apps in 'INSTALLED APPS' I need to add a link in the admin section that will cause the stats to be downloaded. The URL for this link is

Re: Next previous links from a query set / generi views

2010-02-07 Thread Eric Abrahamsen
On Feb 8, 2010, at 7:56 AM, eaman wrote: I'm up to code those two methods... If some one is interested in this thread I managed to code these two methods: get_next | get_prev in order to get a previous or next item in a set right from my model: - http://dpaste.com/155961/ Now that you've

html to a database.

2010-02-07 Thread har
Hi all, do you know the most efficient way to put the content of an html file into a mySQL database? 1.- I have the html document in my hard disk. 2.- Then I Open the file 3.- Read the content 4.- Write all the content it in a SQL db I am using scrapy to crawl through the websites and then i

Re: Deserializing xml or json goes into infinite recursion

2010-02-07 Thread Kurt Schwehr
The top of the traceback might also help with figuring this out: In [4]: objs = [obj for obj in serializers.deserialize('xml',data)] --- RuntimeError Traceback (most recent call last)

Re: No module named urls

2010-02-07 Thread Karen Tracey
On Sun, Feb 7, 2010 at 4:27 PM, Brian wrote: > Hi all, > > I'm putting together a Django application from scratch and have > created my models. I'm trying to activate the admin site now and am > getting the above error. I've tried everything I found on mailing > lists

Re: geodjango Point distance

2010-02-07 Thread theiklabs
http://code.google.com/apis/maps/articles/phpsqlsearch.html I know this is php but it does a good job of explaining make sure to test the distance from one point to itself the geometric functions have upper and lower limits Sent from my Verizon Wireless BlackBerry -Original Message-

Re: Next previous links from a query set / generi views

2010-02-07 Thread eaman
> I'm up to code those two methods... If some one is interested in this thread I managed to code these two methods: get_next | get_prev in order to get a previous or next item in a set right from my model: - http://dpaste.com/155961/ - Is there a better way to get the highest 'previous' item

Re: Callback method on session timeout

2010-02-07 Thread theiklabs
I have a cpu intensive process that only runs when a user logs in. Once they log out or session time out I need to stop this process Sent from my Verizon Wireless BlackBerry -Original Message- From: cootetom Date: Sun, 7 Feb 2010 15:21:58 To: Django

geodjango Point distance

2010-02-07 Thread Evan Bowling
Hey all, I am trying to calculate the spherical and spheroidal distance between two points that aren't stored within any model. I found this post from a few years ago and was wondering if it was resolved: http://www.mail-archive.com/django-users@googlegroups.com/msg40120.html >>> from

No module named urls

2010-02-07 Thread Brian
Hi all, I'm putting together a Django application from scratch and have created my models. I'm trying to activate the admin site now and am getting the above error. I've tried everything I found on mailing lists with no luck. This includes the old style settings.py (which is commented out now) as

Re: Callback method on session timeout

2010-02-07 Thread cootetom
What is the problem you are trying to solve with this? On Feb 7, 12:08 am, adamjamesdrew wrote: > Does django have the ability to do a callback when a session time out > occurs? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: mysql master-master setup

2010-02-07 Thread Dennis Kaarsemaker
On ma, 2010-02-08 at 00:04 +0100, Henrik Genssen wrote: > what is the best way to setup a master-master replication using mysql > with django? Not to do it :) > Has anyone any experiences with this? I did not use it with django, but I have use master-master (or even rings with more than 2).

mysql master-master setup

2010-02-07 Thread Henrik Genssen
HI, what is the best way to setup a master-master replication using mysql with django? Has anyone any experiences with this? Did you use HAProxy in front of mysql? How many connections does django use during one page request / url? (is there a risk, that I hit 2 instances of mysql during one

Re: inputting a request.user into a model on the backend

2010-02-07 Thread Daniel Roseman
On Feb 7, 9:26 pm, kamilski81 wrote: > I am trying to set a user on a model, on the back-end. > >         u = request.user >         g = Goal() >         g.user = u >         form = GoalForm(request.POST, g) > > I am getting the following error: > goal.user_id may not be

inputting a request.user into a model on the backend

2010-02-07 Thread kamilski81
I am trying to set a user on a model, on the back-end. u = request.user g = Goal() g.user = u form = GoalForm(request.POST, g) I am getting the following error: goal.user_id may not be NULL -- You received this message because you are subscribed to the Google

Re: Unit testing Templatetags

2010-02-07 Thread Jari Pennanen
Hey! Thanks a lot, that seems obvious now... I found out that doing this: template.libraries['django.templatetags.mytest'] = register I can then use {% load mytest %} ... for the tags. On 7 helmi, 22:19, Rolando Espinoza La Fuente wrote: > You can see example code >

Re: Unit testing Templatetags

2010-02-07 Thread Rolando Espinoza La Fuente
On Sun, Feb 7, 2010 at 3:56 PM, Jari Pennanen wrote: [...] > >            #print > loader.get_template_from_string(template_content).render(self.context) >            print > template.Template(template_content).render(self.context) > > >    if __name__ == '__main__': >    

Unit testing Templatetags

2010-02-07 Thread Jari Pennanen
Hi! I decided to try to unit test templatetag using following code: import unittest from django import template from django.template import loader register = template.Library() @register.simple_tag def sometag(arg=None): return "ok" class

Deserializing xml or json goes into infinite recursion

2010-02-07 Thread Kurt Schwehr
Hi All, I'm attempting to pull data from an older django server (0.9x) into a django 1.1.1 app. I get an infinite recursion error with either the json or xml data. Is this a problem with version skew and the formats of serialize/deserialize or do I likely have a coding error on my part? This

Re: uniquely identifying an entry

2010-02-07 Thread Waqqas Jabbar
Every model has a field by the name of "id" which is the primary key of the db table u can use SlugField() for a named unique value. On Thu, Feb 4, 2010 at 11:20 PM, harryos wrote: > hi > (sorry about this newbie question..) > I have designed an entry and a category

Re: problem with get_absolute_url

2010-02-07 Thread Mike Ramirez
On Sunday 07 February 2010 10:49:03 jimgardener wrote: > Thanks Mike for the reply. > > I rewrote the method as > @models.permalink > def get_absolute_url(self): > return("myapp_entry_detail",(),{'id':self.id}) > > When I go to the admin interface's edit page for an entry and click > the

Re: problem with get_absolute_url

2010-02-07 Thread jimgardener
Thanks Mike for the reply. I rewrote the method as @models.permalink def get_absolute_url(self): return("myapp_entry_detail",(),{'id':self.id}) When I go to the admin interface's edit page for an entry and click the viewsite button it causes the following error, NoReverseMatch,Reverse for

Date-based generic views - UTC handling

2010-02-07 Thread Wayne Dyck
I have a database model in which the datetime entry of an item is stored as a DateTimeField(). This datetime is stored as UTC. In one of my views, which displays details for each entry, I am converting and formatting the UTC time to PST. I just started using generic views and for

How can _meta.local_fields not match the table schema in the database?

2010-02-07 Thread br...@instantdirectmarketing.com
I'm completely confused about why _meta.local_fields returns more fields than the database table contains. The User model inherits from contrib.auth.models.User. $ mysql -u user -p database Enter password: Reading table information for completion of table and column names You can

Re: django-authopenid user timeout

2010-02-07 Thread Marco Barbosa
Hi Rachel, I can't help your problem but I'm curious after you said "it seems to be working just fine" - how did you manage to make it work? You just followed the site instructions and it works? I got a problem here when i click "register" it will complain that there's missing a parameter on

Re: Next previous links from a query set / generi views

2010-02-07 Thread eaman
On Feb 7, 2:56 pm, Eric Abrahamsen wrote: > On Feb 7, 2010, at 8:54 PM, eaman wrote: [CUT] > The lazy option would probably be to add get_next() and get_previous()   > methods to your model, that return an instance based on whatever   > definition of "next" and "previous"

Re: problem with get_absolute_url

2010-02-07 Thread Mike Ramirez
> Then what you should be returning is the reverse() args, which is the > viewname as a string, > This is wrong, it's the name parameter for the url in urls.py Sorry... Mike -- "One day I woke up and discovered that I was in love with tripe." -- Tom Anderson signature.asc Description:

Re: csrf error on login and admin

2010-02-07 Thread Nixarn
Ok. Most likely the problem is when nginx is giving me 499 (client timeout) errors. On Feb 7, 3:50 pm, Nixarn wrote: > Hmm apparently doesn't work anymore gah... hrmp. Looking into it. > > Niklas > > On Feb 7, 3:18 pm, Nixarn wrote: > > > > > Having the same

Re: Next previous links from a query set / generi views

2010-02-07 Thread Eric Abrahamsen
On Feb 7, 2010, at 8:54 PM, eaman wrote: On Feb 7, 3:24 am, Eric Abrahamsen wrote: Yup, if you have non-null date/datetime fields on your model, each model will automatically get "get_next_by_FOO" and "get_previous_by_FOO" methods, where FOO is the name of the datetime

Re: Reversed URLs problem

2010-02-07 Thread Karen Tracey
On Sun, Feb 7, 2010 at 4:12 AM, Daniel Roseman wrote: > If all URLs work both with and without a prefix, it would seem that > you've somehow duplicated your URL definitions somewhere. Could you > post your entire urls.py? Preferably somewhere like dpaste.com. > Also some

Re: csrf error on login and admin

2010-02-07 Thread Nixarn
Hmm apparently doesn't work anymore gah... hrmp. Looking into it. Niklas On Feb 7, 3:18 pm, Nixarn wrote: > Having the same problem with the dev version of django. I just can't > get into the Admin. > > Works fine in Chrome for some reason but with Firefox or IE I get: > > 403

Re: csrf error on login and admin

2010-02-07 Thread Nixarn
Might have gotten somewhere with this. I'm using nginx and rewriting urls with www to be without www. And in firefox I seem to be getting the following weirdness in firebug: domainname.com, status: timeout, domain: domainname.com, size: 1.8kb, time: 26ms domainname.com, status: 200 OK, domain:

Re: csrf error on login and admin

2010-02-07 Thread Nixarn
Having the same problem with the dev version of django. I just can't get into the Admin. Works fine in Chrome for some reason but with Firefox or IE I get: 403 Forbidden CSRF verification failed. Request aborted. Reason given for failure: CSRF cookie not set. And I've tried clearing the cache

Decorator problem

2010-02-07 Thread cerberos
I'm trying to make a decorator that checks if a user is staff and redirects to the login page if not logged in or returns a 403 for logged in users that aren't staff. I found permission_required_with_403 (http://www.djangosnippets.org/ snippets/254/) which works well so I've added

Re: Next previous links from a query set / generi views

2010-02-07 Thread eaman
On Feb 7, 3:24 am, Eric Abrahamsen wrote: > Yup, if you have non-null date/datetime fields on your model, each   > model will automatically get "get_next_by_FOO" and   > "get_previous_by_FOO" methods, where FOO is the name of the datetime   Well I guess the 'Lazy' optiond is

Re: problem with get_absolute_url

2010-02-07 Thread Mike Ramirez
On Sunday 07 February 2010 01:01:22 jimgardener wrote: > def get_absolute_url(self): > return ('myapp_entry_detail',[self.id]) > Try this @models.permalink def get_abosulte_url(self): return ("myapp_entry_detail", (), {'id': self.id}) --- @models.permalink is the

Re: Reversed URLs problem

2010-02-07 Thread Daniel Roseman
On Feb 7, 1:12 am, adambossy wrote: > Hi folks, I'm having trouble with reversed urls when they are being > called as template tags. I posted my question on Stack Overflow last > week with no adequate responses. I'll copy it here (with slight > modifications) for convenience.

Re: Getting endless redirects when accessing root url

2010-02-07 Thread Dennis Kaarsemaker
On za, 2010-02-06 at 07:52 -0800, Jan wrote: > urlpatterns = patterns('', > (r'^/$', flatpage, { 'url' : 'home/' } ), ^/$ should be ^$ -- Dennis K. The universe tends towards maximum irony. Don't push it. -- You received this message because you are subscribed to the Google Groups

problem with get_absolute_url

2010-02-07 Thread jimgardener
hi I am new to django..and was trying out the permalink method I have defined a get_absolute_url for my Entry class and used permalink. class MyEntry(models.Model): pub_time=models.DateTimeField(default=datetime.now) mycategory=models.ForeignKey() def __unicode__(self):

Re: Pulling a user to save a form

2010-02-07 Thread Daniel Roseman
On Feb 6, 10:11 pm, kamilski81 wrote: > No I am not, once the user is logged in I just want to pull the user > from there...sort of like this > >   if request.method == 'POST': >         instance = request.user >         goal = Goal(user=instance) >         form =