Re: Atomic value increment

2006-07-12 Thread Don Arbow
On Jul 12, 2006, at 7:38 PM, Adrian Holovaty wrote: > > On 7/12/06, Jay Parlar <[EMAIL PROTECTED]> wrote: >> Is there a better way to do this? More specifically, an atomic way to >> generate and set the new unique_id? I can't just use the >> autogenerated >> 'id' primary key as an unique

Re: ManyToMany and filter_interface

2006-07-12 Thread Patrick J. Anderson
[EMAIL PROTECTED] wrote: > I can't seem to get filter_interface on M2M relationships to work. > There are no errors but the admin interface looks identical with and > without the extra directive in there. Here's the relevant field: > > attributes = models.ManyToManyField(Attribute, >

Re: Django Blog Code

2006-07-12 Thread Jeremy Dunck
On 7/12/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > On 7/12/06, keukaman <[EMAIL PROTECTED]> wrote: > > > > Thanks Jeremy! This group has been outstanding in getting me going with > > this outstanding framework. > > > > Do you know of a basic template I can use to display the blog? > > I

Re: Django Blog Code

2006-07-12 Thread Jeremy Dunck
On 7/12/06, keukaman <[EMAIL PROTECTED]> wrote: > > The blog code located at > http://code.djangoproject.com/svn/djangoproject.com/django_website/apps/blog/ > has a directory called "/templatetags" that has a file called > "latestblogentry.py" and __init__.py. > > If my structure is as follows: >

Re: Atomic value increment

2006-07-12 Thread Adrian Holovaty
On 7/12/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > Is there a better way to do this? More specifically, an atomic way to > generate and set the new unique_id? I can't just use the autogenerated > 'id' primary key as an unique identifier, because I have a list of > legacy unique_id values which I

Re: Atomic value increment

2006-07-12 Thread Jay Parlar
On 7/12/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > why not use a GUID ? > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604 That's pretty neat, but I do need the values to increase by one everytime. Jay P. --~--~-~--~~~---~--~~ You received this

ManyToMany and filter_interface

2006-07-12 Thread [EMAIL PROTECTED]
I can't seem to get filter_interface on M2M relationships to work. There are no errors but the admin interface looks identical with and without the extra directive in there. Here's the relevant field: attributes = models.ManyToManyField(Attribute, filter_interface=models.HORIZONTAL,

Re: Django and MySQLdb on Bluehost

2006-07-12 Thread Steve
Nevermind, I figured it out. Gosh I get smarter just by writing to this group :) All I had to do was add the local path of MySQLdb to my .fcgi file under my web root directory. So: sys.path += ['/homedir/pythondir'] --~--~-~--~~~---~--~~ You received this

Django and MySQLdb on Bluehost

2006-07-12 Thread Steve
Hi all, I'm trying to set up Django on Bluehost with MySQL as my db, and I'm running into problems. I was hoping someone who has successfully married MySQLdb to Django on Bluehost can help me out. I'm sure it's something really simple that I am omitting. Bluehost doesn't have MySQLdb

Re: Custom SQL in Q objects

2006-07-12 Thread Russell Keith-Magee
On 7/12/06, Kilian CAVALOTTI <[EMAIL PROTECTED]> wrote: Hi all,I'd like to know if Q objects support custom SQL queries, as used in extra()function?No. Q objects do not support custom SQL - they are just wrappers that can be used to wrap groups of keyword search parameters ( e.g.,

Re: Atomic value increment

2006-07-12 Thread Ian Holsman
why not use a GUID ? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604 On 13/07/2006, at 8:08 AM, Jay Parlar wrote: > > On 7/12/06, Don Arbow <[EMAIL PROTECTED]> wrote: >> >> On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: >>> >>> Is there a better way to do this? More specifically,

Re: Atomic value increment

2006-07-12 Thread Jay Parlar
On 7/12/06, Don Arbow <[EMAIL PROTECTED]> wrote: > > On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: > > > > Is there a better way to do this? More specifically, an atomic way to > > generate and set the new unique_id? I can't just use the autogenerated > > 'id' primary key as an unique

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Bill de hÓra
Iván Alemán wrote: > I mean that actually we're using LAMP environment plus other goodies > like Dojo, so the refined question (hopefully) is, can I integrate any > django project to my actual PHP/MySQL environment with minimum effort > so later (after publishing) we can start worrying about

Re: Password Generator

2006-07-12 Thread Tim
Thanks Felix. This works great. --~--~-~--~~~---~--~~ 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

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Iván Alemán
Heya Jacob, It's great that you spend some time answering this n00b-to-django questions, I saw your talk at Google TechTalks on April 26, 2006 (on google video), the talk got me ;) (but you have to correct those slides LOL) > I'm not sure what you mean by "actual development environment," ...

Re: Alternative to PIL (Python Imaging Library)?

2006-07-12 Thread Jeremy Dunck
On 7/12/06, Carlos Yoder <[EMAIL PROTECTED]> wrote: > Is there a way around PIL? Can Django use another kind of library? If > not, has anyone got around this? Maybe by getting a precompiled Linux > PIL? http://packages.debian.org/unstable/python/python-imaging ?

Alternative to PIL (Python Imaging Library)?

2006-07-12 Thread Carlos Yoder
Hello there guys, Recently I found out that in Django uses PIL to handle image uploads. I managed to get a Bluehost account to run Django (it works! and I'll be putting a *real* tutorial RealSoonNow), but I can't find my way around installing PIL. Installation finishes with gcc belching a lot of

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I got it finally... changed this: return render_to_response('main/index.html') to this: return render_to_response('main/index.html', RequestContext(request, {'request': request})) and that took care of it. Only took a few hours of staring at the generic views code and plenty of trial

Re: How get user, included in generic views?

2006-07-12 Thread hotani
this is what I'm sending out in the view. Basically this is an empty section of the site that will be created later. However, it bothers me that the menus and such will not work correctly since it seems I'm not passing the correct info. from views.py: def index(request): return

Extending the SQL

2006-07-12 Thread Jason Murray
Another question for you all. As soon as I get my model.py ironed out for my existing DB I'm going to starting using the python db interface to see if things look good. Which means of course that I'll want to duplicate some of the queries that the existing app does. The site maintains the

Re: django for end users?

2006-07-12 Thread Kenneth Gonsalves
On 13-Jul-06, at 12:11 AM, eas wrote: > Making a basic blog with Django is pretty simple, but there is some > learning to do, and work to do creating your templates. Starting with > someone elses solution would give you a jump start and probably allow > you to get things up and running

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Phil Powell
Jorge - that is exactly what I was after - thanks very much! I don't have too many categories, and don't expect there to be more than 100 or so - so the convenience outweighs the overhead. This way, I'm even able to add filters before doing the iteration. -Phil On 12/07/06, Jorge Gajon

Re: django for end users?

2006-07-12 Thread eas
I'd go poking through the people whose blogs are aggregated on the community page of the django site. I've seen more than a few of them mention that they have created their own CMSs using Django with blog-like functionality. I know that at least one or two of them have made their code

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Jacob Kaplan-Moss
Hey Ivan -- I'll do my best to answer your questions -- On Jul 12, 2006, at 10:49 AM, Iván Alemán wrote: > does anyone have integrated django with an actual development > environment, like the one I described above LAMP? I'm not sure what you mean by "actual development environment," but you

Re: How get user, included in generic views?

2006-07-12 Thread Guillermo Fernandez Castellanos
Hi, I did identify my problem (user not in context) doing this (thanks Joshua): {% if user %} user in context {% else %} user not in context {% endif %} It's difficult to know where your problem might be without looking at the code... G On 7/12/06, hotani <[EMAIL PROTECTED]> wrote: > > I

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I think I'm missing something in my own views. Everything created by django (admin area, generic views) will get the user info, but when I do a view myself it doesn't work. What little tid-bit am I missing here? --~--~-~--~~~---~--~~ You received this message

inspectdb

2006-07-12 Thread Jason Murray
I have an existing cgi based app that I'm starting to move over to django. I'm looking forward to seeing just what django can do for me. Since the DB has quite a bit of data and I'd like to avoid recreating the DB model in django and moving the actual data, I've elected to use the ispectdb

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Jorge Gajon
Also, I think you need to add null=True to the ForeignKey, like this: category = models.ForeignKey(Category,null=True, blank=True) blank=True indicates the admin interface that a value can be omitted, but null=True is necessary to indicate to the database that the column can be NULL. On

Re: Password Generator

2006-07-12 Thread Scott McCracken
Felix Ingram wrote: > I've put the above on the wiki > (http://code.djangoproject.com/wiki/AdminApplication) which is off the > common pitfalls page. Felix - many thanks for the great explination. This is exactly what I was looking for. --~--~-~--~~~---~--~~ You

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Jorge Gajon
Hi, If there are not a lot of categories (i.e. a thousand or more), you could iterate over all categories and filter only those that have a photo_set of 1 or more. For example in a view you could do: categories = [c for c in Category.objects.all() if c.photo_set.count()] You could say that

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi again, > a ForeignKey to Category in your Project model, i.e. that a Project > belongs to a Category, like this: Ooopss, I left something out there. But any case I wanted to apologize for rushing with my previous email, I did not read the email that Malcolm sent before and he is raising

Menus parent/child foreign key dropdown too big

2006-07-12 Thread Mike
So here's the deal. I have Menus and MenuItems: class Menu(models.Model): name = models.CharField(maxlength=200) class MenuItem(models.Model): menu_id = models.ForeignKey(Menu, blank=False, null=False, edit_inline=models.TABULAR, num_in_admin=3) parent = models.ForeignKey('self',

Re: Having trouble with views

2006-07-12 Thread Jorge Gajon
Hi Tomas, I have not read the previous emails, so please excuse me if I'm misinterpreting something. I'll comment on what you said on the last email only. > I have tried with but > I think I need to write a new function inside views.py in my > "portfolio" app, that will bring out that category

Re: Atomic value increment

2006-07-12 Thread Don Arbow
On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote: > > Is there a better way to do this? More specifically, an atomic way to > generate and set the new unique_id? I can't just use the autogenerated > 'id' primary key as an unique identifier, because I have a list of > legacy unique_id values which I

Re: How get user, included in generic views?

2006-07-12 Thread Guillermo Fernandez Castellanos
Ok, got my problem. May be your problem as well, mamcxyz. I was using the user variable in a menu. In order to make my webpage as generic as possible, I had defined a menu.html that I included with a tag: register = Library() def make_menu(context): pass make_menu =

MAKE EASY MONEY

2006-07-12 Thread Abdullah
http://www.superteklif.com/index.asp?ref=120391 http://www.superteklif.com/index.asp?ref=120391 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How get user, included in generic views?

2006-07-12 Thread hotani
I am having this problem as well, but only for part of my site. The admin area works normally, one of my apps works well, but another app (happens to be the one at '/') does not see the user. {{ user.username }} returns "". It sees someone logged in, so user.is_anonymous is false, but everything

Re: Template error "Could not parse the remainder"

2006-07-12 Thread Spider
Thanks to those who replied; removing the () as suggested worked. --~--~-~--~~~---~--~~ 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

Re: Template error "Could not parse the remainder"

2006-07-12 Thread Brett Parker
On Wed, Jul 12, 2006 at 09:09:22AM -0700, Spider wrote: > > I have this loop in a template : >{% for s in p.schedule_set.all() %} Remove the () and it should be fine > The template engine complains with "Could not parse the remainder: ()" > > Here p is a Plan object instance. Schedule has

Re: Template error "Could not parse the remainder"

2006-07-12 Thread James Bennett
On 7/12/06, Spider <[EMAIL PROTECTED]> wrote: > The template engine complains with "Could not parse the remainder: ()" When doing things like this in a template, you don't use the parentheses; just {% for s in p.schedule_set.all %}' should work. Basically, Django tries a few different lookupg

Template error "Could not parse the remainder"

2006-07-12 Thread Spider
I have this loop in a template : {% for s in p.schedule_set.all() %} The template engine complains with "Could not parse the remainder: ()" Here p is a Plan object instance. Schedule has Plan as a many-to-one foreign key (each Plan has 1 or more Schedules). What I want is to loop through

Re: changed debug to 'False' in settings.py but no change in apache

2006-07-12 Thread hotani
well that did it. I deleted settings.pyc, then ran 'syncdb' and restarted the webserver. Seemed like a lot to go through for a little change! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Atomic value increment

2006-07-12 Thread Jay Parlar
I've got a model something like this: class Product(models.Model) name = models.CharField(...) unique_id = models.PostiveIntegerField(unique=True) Instances of this model are only ever created programatically from a view. My current (and awful) scheme for getting a new unique_id for a

Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Iván Alemán
hello, we're a group of 11 developers + 2 designers, we basically develop using LAMP + Smarty + Subversion and Dojo we are starting a new project that includes several sections and features like blogs, forums, music section, members profiles, etc, some sections are already in a "beta" stage and

Re: ANN: Screencast showing a step by step installation of a real-life Django application on a WebFaction account

2006-07-12 Thread Remi
> I dont' know if it was mentioned in the screen cast, but is the setup > procedure shown here for a shared environment or the dedicated server? The screencast works on both. Remi. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: changed debug to 'False' in settings.py but no change in apache

2006-07-12 Thread Don Arbow
On Jul 12, 2006, at 8:02 AM, hotani wrote: > > I've restarted the webserver but I'm still getting the debug 404 > messages, plus at the bottom it says "You are seeing this because you > have Debug=True in your settings file" when I'm pretty sure I changed > that. Is there something else that

changed debug to 'False' in settings.py but no change in apache

2006-07-12 Thread hotani
I've restarted the webserver but I'm still getting the debug 404 messages, plus at the bottom it says "You are seeing this because you have Debug=True in your settings file" when I'm pretty sure I changed that. Is there something else that needs to be restarted? A cache to be cleared? Anything?

Re: FileBrowser Test Version

2006-07-12 Thread patrickk
as mentioned before, I´m currently getting help from my hosting- provider. trac is already set up on our server - of course, help is still appreciated. Am 12.07.2006 um 16:42 schrieb favo: > > could anyone can help va:patrick.kranzlmueller to setup a open svn > trunk even with a trac

Re: ANN: Screencast showing a step by step installation of a real-life Django application on a WebFaction account

2006-07-12 Thread Kenneth Gonsalves
On 12-Jul-06, at 8:08 PM, [EMAIL PROTECTED] wrote: > I dont' know if it was mentioned in the screen cast, but is the setup > procedure shown here for a shared environment or the dedicated server? webfaction is shared - there is no market for screencasts of setup on a dedicated server --

Re: FileBrowser Test Version

2006-07-12 Thread favo
could anyone can help va:patrick.kranzlmueller to setup a open svn trunk even with a trac system? It's very hard to communicte with feedback - upload - feedback... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: FileBrowser Test Version

2006-07-12 Thread Phil Powell
Still having trouble with those thumbnails Patrick: Seems that whenever I click on the thumbnail link, or the "delete" link, a blank filebrowser index page is returned to me. The URL seems to be formed properly in the form: /admin/filebrowser/makethumb/my_file.jpg Seems to be rendering the

Re: ANN: Screencast showing a step by step installation of a real-life Django application on a WebFaction account

2006-07-12 Thread [EMAIL PROTECTED]
I dont' know if it was mentioned in the screen cast, but is the setup procedure shown here for a shared environment or the dedicated server? -matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Checking whether a Foreignkey object has been assigned to anything

2006-07-12 Thread Le Roux
I recently had a similar problem and ended up just writing some custom sql (see http://www.djangoproject.com/documentation/model_api/#executing-custom-sql) because I can only think of doing this useing a group by clause. (unless you just want the category ids, then you can do a SELECT distinct

Re: Having trouble with views

2006-07-12 Thread Tomas Jacobsen
I will try to explain some more. I have managed to "render" project slug and project title into html. My template is inside "/django/django_templates/portfolio/" and is called "index.html". If I try to type in "mydomain.com/portfolio" I get the nice list of project name, and inside the "a href"

Re: TABULAR ImageField gets deleted

2006-07-12 Thread Enrico
Hi Joshua, That's exactly what happened to me, maybe we should open a ticket... Thanks for your workaround, it worked. I didn't need another field, but it wouldn't hurt to add a description, then I made it "core" and now it works. Regards. Enrico

Re: FileBrowser Test Version

2006-07-12 Thread patrickk
makethumb works for me - although the makethumb-image is not displayed correctly (I´ve already changed that). change line 170 of filebrowser/views.py from path_to_file = '/media/img/filebrowser_Thumb.gif' to path_to_file = '/media/img/filebrowser/filebrowser_Thumb.gif' note: our

Re: FileBrowser Test Version

2006-07-12 Thread Phil Powell
Thanks for the update Patrick. I've got this part working, but having trouble with makethumb on existing files on the server - not had time to delve too deeply yet to see what the problem is though. -Phil On 11/07/06, va:patrick.kranzlmueller <[EMAIL PROTECTED]> wrote: > > a new version of the

Re: Having trouble with views

2006-07-12 Thread Malcolm Tredinnick
On Tue, 2006-07-11 at 15:30 -0700, Tomas Jacobsen wrote: > Wow, thanks for the help! I do understand the principle of views and > templates now, but I still need some help. > > I have managed to get out the slug name of my projects in > "mydomain/portfolio/". But I don't know how I write the

Re: Password Generator

2006-07-12 Thread Jyrki Pulliainen
On 7/12/06, Felix Ingram <[EMAIL PROTECTED]> wrote: > > On 7/12/06, Jyrki Pulliainen <[EMAIL PROTECTED]> wrote: > > > > On 7/12/06, Felix Ingram <[EMAIL PROTECTED]> wrote: > > > > salt = sha.new(str(random.random())).hexdigest()[:5] > > > > Dunno is this really a developer question, but is there

Re: Password Generator

2006-07-12 Thread Felix Ingram
On 7/12/06, Jyrki Pulliainen <[EMAIL PROTECTED]> wrote: > > On 7/12/06, Felix Ingram <[EMAIL PROTECTED]> wrote: > > > salt = sha.new(str(random.random())).hexdigest()[:5] > > Dunno is this really a developer question, but is there really a point > using sha there? That one could be done without

Re: Password Generator

2006-07-12 Thread Jyrki Pulliainen
On 7/12/06, Felix Ingram <[EMAIL PROTECTED]> wrote: > > salt = sha.new(str(random.random())).hexdigest()[:5] Dunno is this really a developer question, but is there really a point using sha there? That one could be done without sha too using random.getrandbits(bits), eg.: ('%x' %

Re: Template tags and context processors

2006-07-12 Thread Malcolm Tredinnick
On Wed, 2006-07-12 at 09:18 +, plungerman wrote: [...] > > class GetCodebit(template.Node): > > def __init__(self, arg1, arg2): > self.varname = arg1 > self.name = arg2 > > def __repr__(self): > return "" > > def render(self, context): > codebit

Re: Password Generator

2006-07-12 Thread Felix Ingram
On 7/12/06, Felix Ingram <[EMAIL PROTECTED]> wrote: > On 7/12/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > So whack the following into a script or type it into a interactive session > > import sha, random > raw_password = script though)> > algo = 'sha1' > salt =

conflict between edit_inline and ManyToManyField

2006-07-12 Thread arnodel
Hi everyone, I am trying to get to grips with django and so far I find it wonderful! But I am stuck on the following problem, which I have tried to make a test case of below (see models.py). The problem is that when I try to add a new parent with some children, then I get an error relating to

Re: how to create model with one object?

2006-07-12 Thread [EMAIL PROTECTED]
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

Re: Template tags and context processors

2006-07-12 Thread plungerman
Malcolm Tredinnick wrote: > On Tue, 2006-07-11 at 15:38 +, plungerman wrote: > > greetings, > > > > i have been working on a template loader to retrieve templates from the > > database. after integrating the loader to work with the django's > > admin, i now serve up templates from both the

Re: Password Generator

2006-07-12 Thread Felix Ingram
On 7/12/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Wed, 2006-07-12 at 03:18 +, Scott McCracken wrote: > > I also ran into this problem when trying to create new users in the > > Django admin interface. According to the Django documentation "We've > > added extra security to the

Custom SQL in Q objects

2006-07-12 Thread Kilian CAVALOTTI
Hi all, I'd like to know if Q objects support custom SQL queries, as used in extra() function? -- Kilian CAVALOTTI Administrateur réseaux et systèmes UPMC / CNRS - LIP6 (C870) 8, rue du Capitaine Scott Tel. : 01 44 27 88 54 75015 Paris - France

Re: how to create model with one object?

2006-07-12 Thread Aidas Bendoraitis
Don't set the permissions to add and delete that type of object to the end user (content administrator) and don't give him a superuser status. That should let him only edit an existing object of a model. Aidas Bendoraitis [aka Archatas] On 7/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

About iServicePro

2006-07-12 Thread zw_sea
iServicePro is an innovative approach to offering affordable tools for Java and J2EE developers. in particular, we are a professional team for applying oneself to develop and integrate eclipse plug-in for user applications. Our mission now is to deliver business value and to maximize developers'

how to create model with one object?

2006-07-12 Thread [EMAIL PROTECTED]
Hi! I want create model with one object in all project and I want admin interface for change this object not delete or add. Can I do it? Dimon. from django.db import models class Banner(models.Model): middle1 = models.ImageField('131x77 #1', upload_to='banners', blank=True,

Re: IBM Article on TurboGears (w / Django Comparison)

2006-07-12 Thread Iain Duncan
Good read Ian, thanks for the post. Iain Ian Maurer wrote: > IBM has published the 2nd part in my two-part series on Web > Development frameworks. > > http://www-128.ibm.com/developerworks/linux/library/l-turbogears/ > > Also, at the end of this article I include my comparison of the 2 >

django for end users?

2006-07-12 Thread maphew
okay, here's the background: I've been maintaining some websites since the mid 90s. Most of it badly. I've coded by hand, used dreamweaver, blosxom, twiki, and a few other doodads along the way like wordpress and joomla. I'm sick of all of them and want "a better way". I wouldn't call myself a