Re: what to use for search facility

2009-01-18 Thread krylatij
Sphinx Here samples http://softwaremaniacs.org/blog/2007/11/04/sphinx-search-in-cicero/ (but in Russian) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Adam Yee
Success. I added 'script_name': request.META['SCRIPT_NAME'] into the context of object_detail() in django's generic views list_detail.py. Here's the modified form tag to the polls_detail.html template: Note removing the / before {{ script_name }} Just to reiterate what Preston said, please

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Adam Yee
On Jan 18, 7:39 am, ptone wrote: > In the tutorial, the form action in the poll_detail template is > hardcoded to "/polls/..." > > So the browser is doing what's been explicitly asked of it, despite > Django doing its best to deal gracefully with your mounting the app > at /mysite. > > In my own

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Adam Yee
On Jan 18, 3:44 am, Graham Dumpleton wrote: > On Jan 18, 8:46 pm, Adam Yee wrote: > > > > > > > On Jan 17, 8:36 pm, Malcolm Tredinnick > > wrote: > > > > On Jan 18, 2:53 pm, Adam Yee wrote: > > > > > It was a slam dunk for completing the tutorial in the development > > > > server, but I can't

Re: Any libraries to create an online help system in Django or Python?

2009-01-18 Thread alibongo
Thanks to you both. I'll look into Sphinx and see if that meets my needs. Alison On Jan 18, 3:33 pm, Malcolm Tredinnick wrote: > On Sat, 2009-01-17 at 19:28 -0700, Jeff Anderson wrote: > > I'd suggest using sphinx. It's designed for documenting Python projects, > > and it's the documentation bu

Re: How to receive Emails in my django app

2009-01-18 Thread Tiago S.
Hi, Take a look on this opensource app. It's a helpdesk system and it receives email and process then afterward. http://code.google.com/p/jutda-helpdesk/ Regards, On Jan 16, 4:11 pm, zweb wrote: > i can send emails easily using django. > > I want to set up an email address, where users can se

Re: Possible to see sql for queryset before database gets it?

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 17:46 -0200, Ramiro Morales wrote: [] > > or if you are using a recent trunk version (more recent than two weeks or so) > you might want to try printing the output of: > > .as_sql() Please don't recommend that one, it's very likely to change in the near future (like, t

Re: Do Mysql Views and Django work together?

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 10:59 -0800, phoebebright wrote: > Got django reading the view ok. Potential problem where table uses two > fields as a primary key - don't think django likes this, but think I > can use a view to get around this one too. Yes, we don't support multi-column primary keys at th

Re: how to enforce uniqueness

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 09:58 -0700, Dj Gilcrease wrote: > On Sun, Jan 18, 2009 at 4:34 AM, Malcolm Tredinnick > wrote: > >> Right now, that is only enforced by the admin interface, > > > > I should have extended this to also say "and ModelForms", since if you > > create a ModelForm from a Model, u

Q about cache backend for sessions and clustering

2009-01-18 Thread Andrew Ingram
The new cache backend for sessions in 1.1 looks very promising, I just have a quick question. When running in a cluster, we need to make sure that if a user hops from one server to another that the session data remains in sync between the requests. I know that with the db backend the response

Re: don't find index.html

2009-01-18 Thread Karen Tracey
On Sun, Jan 18, 2009 at 6:29 PM, thomasgrzybow...@gmail.com < thomasgrzybow...@gmail.com> wrote: > > I am working my way though the tutorials with Django version 1.0.2; so > far, so good, until I get stuck about half way through tutorial 3. I > have created an index.html file under '/home/tg/temp

don't find index.html

2009-01-18 Thread thomasgrzybow...@gmail.com
I am working my way though the tutorials with Django version 1.0.2; so far, so good, until I get stuck about half way through tutorial 3. I have created an index.html file under '/home/tg/templates/polls'. I have specified the search path(s) for the templates in settings.py as follows: TEMPLAT

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Graham Dumpleton
On Jan 19, 3:02 am, JCorey wrote: > On Jan 18, 9:39 am, ptone wrote: > > > In the tutorial, the form action in the poll_detail template is > > hardcoded to "/polls/..." > > > So the browser is doing what's been explicitly asked of it, despite > > Django doing its best to deal gracefully with y

Re: Multiple django instances in apache; dynamic configuration

2009-01-18 Thread Graham Dumpleton
On Jan 19, 8:00 am, appleseed249 wrote: > Hi all - > > I am building a site where users can register and deploy their own > instances of Django. This isn't a public hosting site, just some > distributed system work I'm doing for a class project. > The Django instances are deployed on apache. I

Multiple django instances in apache; dynamic configuration

2009-01-18 Thread appleseed249
Hi all - I am building a site where users can register and deploy their own instances of Django. This isn't a public hosting site, just some distributed system work I'm doing for a class project. The Django instances are deployed on apache. I want to be able to dynamically add new Django instance

Re: Possible to see sql for queryset before database gets it?

2009-01-18 Thread Ramiro Morales
On Sun, Jan 18, 2009 at 5:27 PM, phoebebright wrote: > > I have a problem with the sql being generated by this: > >tasks = Task.objects.filter(status='open').order_by('-priority') >tasks = tasks.extra(where=['list IN %s'], params= > [settings.MY_LISTS]) > > Is there a command where I can

Re: Blueprint css versus YUI grids versus ?

2009-01-18 Thread phoebebright
Thanks for the tip on blueprint. I'm going to give it a go. Been using YUI and keen to find something to ween a designer off of tables within tables within tables within tables etc. YUI just not easy enough to explain and use and had to take it out of last development. On Jan 17, 9:34 pm, a b

Possible to see sql for queryset before database gets it?

2009-01-18 Thread phoebebright
I have a problem with the sql being generated by this: tasks = Task.objects.filter(status='open').order_by('-priority') tasks = tasks.extra(where=['list IN %s'], params= [settings.MY_LISTS]) Is there a command where I can say something like 'print tasks.sql' that would generate the sql b

Re: Do Mysql Views and Django work together?

2009-01-18 Thread phoebebright
Got django reading the view ok. Potential problem where table uses two fields as a primary key - don't think django likes this, but think I can use a view to get around this one too. On Jan 17, 1:59 pm, phoebebright wrote: > That sounds like a very useful feature - gets my vote. > > Will have a

Re: ManyToManyField.through for what?

2009-01-18 Thread Ramiro Morales
On Sun, Jan 18, 2009 at 2:46 PM, Erik Bernoth wrote: > > Thanks very much. I see I have still other options where I can look > first: trac and unit tests. Will read all of that. :) Ideas and patches to enhance the documentation making this more straight forward to understand for the next person

Re: how to enforce uniqueness

2009-01-18 Thread Dj Gilcrease
On Sun, Jan 18, 2009 at 4:34 AM, Malcolm Tredinnick wrote: >> Right now, that is only enforced by the admin interface, > > I should have extended this to also say "and ModelForms", since if you > create a ModelForm from a Model, unique and unique_together are > respected. It's respected for any

Re: ManyToManyField.through for what?

2009-01-18 Thread Erik Bernoth
On 18 Jan., 17:27, Ramiro Morales wrote: > On Sun, Jan 18, 2009 at 1:20 PM, Erik Bernoth wrote: > > > Hi guys, > > I'm trying to create a db model in Django. And until now I created n:m- > > Relations with own tables, because in many cases I need extra > > information like the creation date of t

Re: ManyToManyField.through for what?

2009-01-18 Thread Ramiro Morales
On Sun, Jan 18, 2009 at 1:20 PM, Erik Bernoth wrote: > > Hi guys, > I'm trying to create a db model in Django. And until now I created n:m- > Relations with own tables, because in many cases I need extra > information like the creation date of that connection-entity. And now > I found in the docs

Re: ForeignKeys and select_related

2009-01-18 Thread Preston Holmes
So just for completeness, here is the bit about avoiding the inner for loop in this situation: On Jan 17, 8:40 am, ptone wrote: > matching_torrents = Torrent.objects.filter(name__icontains='x360') > my_data = [] > for a_torrent in matching_torrents: >     info_objects = a_torrent.torrentInfo_se

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread JCorey
On Jan 18, 9:39 am, ptone wrote: > In the tutorial, the form action in the poll_detail template is > hardcoded to "/polls/..." > > So the browser is doing what's been explicitly asked of it, despite > Django doing its best to deal gracefully with your mounting the app > at /mysite. The same thin

formfield_for_foreignkey help needed.

2009-01-18 Thread mweather
This is probably really sinple, but I'm pretty new to Sjango, and I can't seem to figure it out. I've used Django before, and came back to it once I saw the recent commit that added ability to override admin formfields, which looks to be exactly what I need. I have a Product model and an Affilia

what to use for search facility

2009-01-18 Thread Konstantin
Hello In my project I'll need to implement search facility through user's private pages (so google custom search is not available). What is the best option for this kind of task in django ? I'd like to use postgres (though it's not a strict requirement, mysql based solution will be fine) with tse

Re: Check if user is in a list

2009-01-18 Thread Darthmahon
Hey DR, that works perfectly! Cheers, Chris On Jan 18, 1:44 pm, Daniel Roseman wrote: > On Jan 18, 12:43 pm, Darthmahon wrote: > > > > > Hey Guys, > > > I've got a model like this: > > > event   = models.ForeignKey(Event) > > user            = models.ForeignKey(UserProfile) > > user_2  = model

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread ptone
In the tutorial, the form action in the poll_detail template is hardcoded to "/polls/..." So the browser is doing what's been explicitly asked of it, despite Django doing its best to deal gracefully with your mounting the app at /mysite. In my own newcomer approach, the way I found to work aroun

ManyToManyField.through for what?

2009-01-18 Thread Erik Bernoth
Hi guys, I'm trying to create a db model in Django. And until now I created n:m- Relations with own tables, because in many cases I need extra information like the creation date of that connection-entity. And now I found in the docs that it is possible to connect these individual n:m tables of mys

Re: Changing data format in admin

2009-01-18 Thread Kless
I answer myself. It's created a function that returns the desired way, and it's added to the list_display. def id_fixed(self): return "%03d" % self.id On 17 ene, 17:19, Kless wrote: > I would show a numeric field with 3 digits into the admin interface > >    list

Re: Traceback in the ``runserver`` console

2009-01-18 Thread Russell Keith-Magee
On Sun, Jan 18, 2009 at 8:25 PM, Simon Forman wrote: > > On Dec 27 2008, 5:14 am, "Russell Keith-Magee" > wrote: >> On Sat, Dec 27, 2008 at 2:32 AM, Fridrik Mar Jonsson >> wrote: >> >> > I recently had an instance where it would have been really convenient >> > to see the error and a traceback

Re: Check if user is in a list

2009-01-18 Thread Daniel Roseman
On Jan 18, 12:43 pm, Darthmahon wrote: > Hey Guys, > > I've got a model like this: > > event   = models.ForeignKey(Event) > user            = models.ForeignKey(UserProfile) > user_2  = models.ForeignKey(UserProfile, related_name='user_2') > > I then get a list of all the invites: > > people_invit

Re: Pickling a dictionary into a PostgreSQL database?

2009-01-18 Thread teth
Using str(pickle.dumps()) and the pickle.loads(str()) works perfectly. The reason I use a dict instead of a list is because I can add an entry that does not come in numeric order (with a list you cannot add an item to it simply by list[32] if the list is not that long). I used a dict because it

Re: ELSE condition not working

2009-01-18 Thread Ned Batchelder
I think this may be a simple misunderstanding of the Python if statement. You said "when I try to edit, it always enters the else condition, delete works fine". Your code structure is this: if edit: # do edit if delete: # do delete else: # do something else If you c

FileBrowser: Easy access to generated images from the template?

2009-01-18 Thread Benjamin Buch
I'm using django-filebrowser (http://code.google.com/p/django-filebrowser/ ) to upload and manage files within my project. And it's working great! Filebrowser is a great app. The only problem I'm having is this: I coupled filebrowser with on of my models ('News') and use the FileBrowse-Field f

Check if user is in a list

2009-01-18 Thread Darthmahon
Hey Guys, I've got a model like this: event = models.ForeignKey(Event) user= models.ForeignKey(UserProfile) user_2 = models.ForeignKey(UserProfile, related_name='user_2') I then get a list of all the invites: people_invited = EventInvitation.objects.filter (event=event).select_r

Re: syncdb error

2009-01-18 Thread Ramiro Morales
On Sun, Jan 18, 2009 at 6:13 AM, joti chand wrote: > > Can you elaborate more please because iam new to this...iam using > python, django and mysql 5.0.django and python works but python > and mysql5.0 not working As you've been told, you need to install the Python library that allows the la

Re: Best practise for using settings in templates

2009-01-18 Thread phoebebright
Thanks - learning more every day! On Jan 18, 11:37 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-18 at 03:26 -0800, phoebebright wrote: > > What is best practise if you want to use a variable defined in > > settings.py in a template? > > Pass it in via the view or call it directly in the templ

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Graham Dumpleton
On Jan 18, 8:46 pm, Adam Yee wrote: > On Jan 17, 8:36 pm, Malcolm Tredinnick > wrote: > > > > > On Jan 18, 2:53 pm, Adam Yee wrote: > > > > It was a slam dunk for completing the tutorial in the development > > > server, but I can't figure out this issue I'm having with the generic > > > views

Re: Best practise for using settings in templates

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 03:26 -0800, phoebebright wrote: > What is best practise if you want to use a variable defined in > settings.py in a template? > Pass it in via the view or call it directly in the template? Since you can't access it directly in a template, that leaves only the former option

Re: how to enforce uniqueness

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 22:32 +1100, Malcolm Tredinnick wrote: [...] > Have a look at unique_together: > http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together > > Right now, that is only enforced by the admin interface, I should have extended this to also say "and ModelForms", s

Re: how to enforce uniqueness

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 02:40 -0800, Konstantin wrote: > Hello! > > First of all I want to apologize for maybe very basic question, but I > newbie in django and web coming from c/c++ world. > > I have two models: > > class Box(models.Model): > description = models.CharField(max_length=250) >

Best practise for using settings in templates

2009-01-18 Thread phoebebright
What is best practise if you want to use a variable defined in settings.py in a template? Pass it in via the view or call it directly in the template? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: Traceback in the ``runserver`` console

2009-01-18 Thread Simon Forman
On Dec 27 2008, 5:14 am, "Russell Keith-Magee" wrote: > On Sat, Dec 27, 2008 at 2:32 AM, Fridrik Mar Jonsson > wrote: > > > > > Hi Djangonians, > > > I recently had an instance where it would have been really convenient > > to see the error and a traceback in the ``runserver`` console instead >

Re: how to enforce uniqueness

2009-01-18 Thread phoebebright
Maybe this would help? http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together On Jan 18, 10:40 am, Konstantin wrote: > Hello! > > First of all I want to apologize for maybe very basic question, but I > newbie in django and web coming from c/c++ world. > > I have two models: >

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Graham Dumpleton
On Jan 18, 3:36 pm, Malcolm Tredinnick wrote: > On Jan 18, 2:53 pm, Adam Yee wrote: > > > It was a slam dunk for completing the tutorial in the development > > server, but I can't figure out this issue I'm having with the generic > > views while using my apache server.  I'm unable to get the v

how to enforce uniqueness

2009-01-18 Thread Konstantin
Hello! First of all I want to apologize for maybe very basic question, but I newbie in django and web coming from c/c++ world. I have two models: class Box(models.Model): description = models.CharField(max_length=250) id = models.IntegerField(primary_key=True) def __unicode__(self)

Re: Comparing values from multiple tables; *show new posts* forum feature

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 02:48 -0800, Piotr Husiatyński wrote: > Hello, > I'm writing forum and I have a problem with *show new posts* feature. > Here's the code of my application: > > http://github.com/husio/arch-pl/tree/09234f6d780c76b45b5e1a6576d80080507873d4/forum > > I have two tables for *new

Comparing values from multiple tables; *show new posts* forum feature

2009-01-18 Thread Piotr Husiatyński
Hello, I'm writing forum and I have a problem with *show new posts* feature. Here's the code of my application: http://github.com/husio/arch-pl/tree/09234f6d780c76b45b5e1a6576d80080507873d4/forum I have two tables for *new* posts - AllVisited for marking all posts as visited - VisitedThread for

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 01:46 -0800, Adam Yee wrote: [...] > I'm still very puzzled by not being able to use '/mysite'. I agree > with you that somewhere '/mysite' is being stripped or just not being > accessed at all. My guess is somewhere in the generic views and/or > how they are set up in the

Re: Deploying Django tutorial part 4, redirecting problem, apache error

2009-01-18 Thread Adam Yee
On Jan 17, 8:36 pm, Malcolm Tredinnick wrote: > On Jan 18, 2:53 pm, Adam Yee wrote: > > > It was a slam dunk for completing the tutorial in the development > > server, but I can't figure out this issue I'm having with the generic > > views while using my apache server.  I'm unable to get the v

Re: syncdb error

2009-01-18 Thread joti chand
Can you elaborate more please because iam new to this...iam using python, django and mysql 5.0.django and python works but python and mysql5.0 not working On Sun, Jan 18, 2009 at 8:57 PM, Tirta K. Untario wrote: > You don't have mysqldb module on your system. Install it by using this: > 'e