General help and help with an ordered ManyToMany

2007-02-07 Thread Michael Lake
Hi all Im trying to write my first djano app. It's for a lab where users will have a list of experiments each experiment consists of several procedures in order. Very much like the Pizzas and Toppings in the documentation but procedures are ordered - as toppings should be for pizzas :-) I

Re: Per object permissions

2007-02-07 Thread Jay Parlar
On 2/7/07, Scanner <[EMAIL PROTECTED]> wrote: > Is someone actively merging in stuff from mainline? > I emailed the address listed on the wiki page at djangoproject.com > for the project but either my spam filter ate the response or I have > not gotten any response. Chris Long was the original

Best Practices for faster template rendering

2007-02-07 Thread Derek Lee-Wo
I just started working with Django about a week ago and I love it. I was able to get my first webapp up and running faster than I have with various other technologies I've used in the past. One problem I'm having though is the speed of the template rendering. That is, the call to

Re: ManyToOneRel error on newforms branch

2007-02-07 Thread Mae
hah. Thank you, that may not solve my problem, but it at least helps me see why. I'm guessing that one of the trunk to newforms merges missed the raw_id_admin-elimination code. I'm afraid I'm not yet expert enough to do such a merge myself... Scotch for me, please. On Feb 7, 9:56 pm, "Honza

Re: ManyToOneRel error on newforms branch

2007-02-07 Thread Honza Král
On 2/8/07, Mae <[EMAIL PROTECTED]> wrote: > > I don't have any raw_id_admins in my code... :( yeah, I am sorry, I jumped to the wrong conclusion (note to self, do not post after having more beers)... the problem seems to ( grep -r raw_id_admin django_src_dir ) be in

Re: ManyToOneRel error on newforms branch

2007-02-07 Thread Mae
I don't have any raw_id_admins in my code... :( On Feb 7, 9:51 pm, "Honza Král" <[EMAIL PROTECTED]> wrote: > On 2/8/07, Mae <[EMAIL PROTECTED]> wrote: > > > > > So, I have a model that's set up exactly like the docs on Many-To-Many > > relationships with intermediary tables describe here

Re: ManyToOneRel error on newforms branch

2007-02-07 Thread Honza Král
On 2/8/07, Mae <[EMAIL PROTECTED]> wrote: > > So, I have a model that's set up exactly like the docs on Many-To-Many > relationships with intermediary tables describe here (http:// > www.djangoproject.com/documentation/models/m2m_intermediary/). > > Using the most recent django-newforms branch,

ManyToOneRel error on newforms branch

2007-02-07 Thread Mae
So, I have a model that's set up exactly like the docs on Many-To-Many relationships with intermediary tables describe here (http:// www.djangoproject.com/documentation/models/m2m_intermediary/). Using the most recent django-newforms branch, when I try to add an Article in admin, I get this

Re: Per object permissions

2007-02-07 Thread Scanner
On Feb 7, 2:36 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > I, for one, am keen to see per-object permissions merged into trunk. > In terms of timelines, it probably won't happen before v1.0, but it is > definitely on the list of things to do. > > However, like all the branches, it

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread wandering . womble
> let me see if I understand your situation- you want to replace the > frontend entirely, and keep your current backend tools. The front end > has a web interface, the back end is all command-line. > > You're thinking about redoing the front end completely, in Django, and > using the Django ORM

Re: save many to many data

2007-02-07 Thread Russell Keith-Magee
On 2/7/07, Antonio <[EMAIL PROTECTED]> wrote: > > * mercoledì 07 febbraio 2007, alle 11:27, Russell Keith-Magee wrote : > > > but the data are added also when I update the Previsione ... > > > searching on group archive, I think I must implement a 'save' method > > > into the Previsione class ...

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread wandering . womble
Thanks James, I think you've made my day :-) > > So long as the settings are configured before this import, and so long > as you have a models file which includes correct Django model > definitions, yes it will work. > > -- --~--~-~--~~~---~--~~ You received

Re: ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
Feb 7, 3:03 pm, "yary" <[EMAIL PROTECTED]> wrote: > ... If I could get some guidance as to writing the test > (as mentioned in the 2nd half of my original message) I'd me much > obliged, and will get to work on patching #2720. I think I can figure it out, will ping back if I have a more specific

Re: ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
Thanks for the ref. That patch doesn't address the problem of a ManyToMany field referring to not-yet-created tables, and the patch breaks my project. If I could get some guidance as to writing the test (as mentioned in the 2nd half of my original message) I'd me much obliged, and will get to

Re: heads-up: changeset 4459 broke admin (?)

2007-02-07 Thread Russell Keith-Magee
On 2/7/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > Hi, > > we are still waiting for confirmation, but it seems that with > changeset 4459, adding inline items in the admin is broken. See > ticket #3447. The resulting error looks like this: I've reverted [4459]. Admin should be back to

Re: ForeignKey model vs. Foreign Key database

2007-02-07 Thread Russell Keith-Magee
On 2/8/07, yary <[EMAIL PROTECTED]> wrote: > > A little digging shows me that MySQL (windows, 5.0, InnoDB tables) > ignores the "REFERENCES" clause on a column. The only foreign keys it > was creating were the ones listed as "pending_references" in > management.py- that is, foreign key references

Re: Per object permissions

2007-02-07 Thread Russell Keith-Magee
On 2/7/07, Edward Muller <[EMAIL PROTECTED]> wrote: > > What happened to the per object permission branches? Are they going > to be integrated into django? I, for one, am keen to see per-object permissions merged into trunk. In terms of timelines, it probably won't happen before v1.0, but it is

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread yary
On Feb 7, 1:22 pm, [EMAIL PROTECTED] wrote: > Thanks for the link! > Would I really have to set up my backend app as a Django App? > Is it required to due to some meta-programming magic? > ie I'd rather not have to run our app via manage.py/django-admin. let me see if I understand your

Re: Internacionalization of data from an object

2007-02-07 Thread Reinhard Knobelspies
You should follow this discussion http://groups.google.com/group/django-users/browse_frm/thread/6a96426735ffd7f1 On Feb 7, 7:16 pm, "Michel Thadeu Sabchuk" <[EMAIL PROTECTED]> wrote: > Hi guys, > > I developing a site that uses i18n, I make my .po file, it's ok for > almost everything, my only

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread James Bennett
On 2/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Thanks for the link! > Would I really have to set up my backend app as a Django App? > Is it required to due to some meta-programming magic? > ie I'd rather not have to run our app via manage.py/django-admin. You don't have to build a

FileField, admin, newforms branch

2007-02-07 Thread Mae
Folks? Anyone? We're trying to write a pretty cool app here -- it'll be a very simple ecommerce engine for the smaller internet shops. When done, we're hoping to give it back to the community. I really want to use the newforms branch, but not having file uploads in admin is a dealbreaker for

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread wandering . womble
> You should be able to just set up a minimal Django project with > settings to specify a database and an INSTALLED_APPS list, and then > things will just work. If you don't want to use a settings file, you > could even do it with manual settings configuration: > Thanks for the link! Would I

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread [EMAIL PROTECTED]
This will probably help out. http://code.djangoproject.com/wiki/InitialSQLDataDiangoORMWay On Feb 7, 3:30 pm, [EMAIL PROTECTED] wrote: > Hi there- > > Let me describe the situation we have. I'm working on a test > automation system, with a backend python script that does the actual > testing.

Re: Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread James Bennett
On 2/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The key questions are: > -can we use Django's 'models.py' DB abstraction API from outside of > Django? > -if so, how? > -what libraries would we need to import? > -Anything we'd need to setup before hand? You should be able to just

Newbie: is it possible to use Django's db API outside of Django?

2007-02-07 Thread Wandering . Womble
Hi there- Let me describe the situation we have. I'm working on a test automation system, with a backend python script that does the actual testing. The frontend is currently a PHP web application. Between the two is a database- web app adds rows, python scheduler polls for new rows. We'd

Re: passing arguments to the login_required decorator

2007-02-07 Thread Georgi Stanojevski
Mike H напиша: > I am using the login_required decorator form > django.contrib.auth.decorators, but I want to override the second > argument which specified which url it should redirect to if the user is > not logged in. It's not messy to write your own. login_required only uses

Re: Comparing datetime

2007-02-07 Thread [EMAIL PROTECTED]
Thank you both! On Feb 7, 1:23 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 2/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > So, how would I say something like > > > if sponsor.period_end < now + 2 weeks: > > Use datetime.timedelta: > > import datetime > if sponsor.period_end <

Internacionalization of data from an object

2007-02-07 Thread Michel Thadeu Sabchuk
Hi guys, I developing a site that uses i18n, I make my .po file, it's ok for almost everything, my only question is how can I work with internationalization on my objects. Suppose I have an object Article and I must must insert an Article in English and in Brazilian portuguese, what is the

Comparing datetime

2007-02-07 Thread [EMAIL PROTECTED]
I have an app to keep track of my site sponsors. One of the fields is a datetime field for when their sponsorship period ends. What I'd like to do is send myself a notification (through a cron job) when that date is coming up, say two weeks away. So, how would I say something like if

ForeignKey model vs. Foreign Key database

2007-02-07 Thread yary
I was looking at the Django-created database structure for my project in a tool that shows all the foriegn-key relationships with nice little lines (aka ER diagram). It looked very sparse. Most of my relationships weren't showing up. A little digging shows me that MySQL (windows, 5.0, InnoDB

Re: Reverse M2M

2007-02-07 Thread Enrico
Hi Ross, The empty Q is the same thing as nothing, no filter. I need to filter the query according to the options the user checks on the form. So this line: (form.data.get('my') and Q(friends_set=request.user.id) or Q()) means: (if checkbox 'my' is checked filter using

Is That Believable !!

2007-02-07 Thread Lucy
*Media Mall Toolbar : Advanced 1-click System to the Following Items :* *- 200 Live TV Channels - FM Radio With alot of Radio Stations and You Can Add More. - Live WebCams around The World - Tools and Essentials as : Online Spyware Scanners,Online Virus Scanners and Online

Re: Background process within django

2007-02-07 Thread Joseph Heck
Depending on how you're running Django, this could be fairly straightforward (or not). Using a setup with apache+mod_python, Any processes you fork off and execute will run with the permissions of how you're running Django. In the case of apache+mod_python on Ubuntu, a process forked off will run

Re: django variables in template

2007-02-07 Thread Mae
It sounds like you're passing the variable in your context, but {{x}} doesn't get converted to {{some_value}} in the script text. This may be because you're html-including the script in your page without passing it through urls.py first. Here's what I do: 1) the scripts that need to get

Re: FileField broken in admin of newforms branch

2007-02-07 Thread Mae
Oh, and I've tried messing about with widget=... parameters, but that throws errors (not surprisingly -- the admin interface doesn't even use newforms yet). On Feb 6, 6:35 pm, "Mae" <[EMAIL PROTECTED]> wrote: > Hi folks, > > I need help to make my FileFields display nice "browse" buttons and be

Re: moving url's of my site

2007-02-07 Thread Reinmar
If you need to be flexible that way, I suppose you could set up a constant like URL_PREFIX in a module, e.g. yourproject/constants.py, and then from yourproject.constants import URL_PREFIX in your various urls.py, models.py and views to have access to it and insert it into urlpatterns,

Re: passing arguments to the login_required decorator

2007-02-07 Thread Lawrence Oluyede
> How can I pass in the user to authenitcate and the login url arguments to > the decorator directly? You can simply use your own decorator and not the Django's. Take the django login_required decorator and modify it accordingly to your needs. You need to change the LOGIN_URL constant. What's

Re: Change class name in Admin interface

2007-02-07 Thread Dirk Eschler
On Mittwoch, 7. Februar 2007, Dirk Eschler wrote: > Do you already use Django's i18n support? In this case you can mark the > verbose_name and verbose_name_plural strings as translateable. Then > create-messages.py will find it when executed the next time. It's "make-messages.py" not

Re: Reverse M2M

2007-02-07 Thread [EMAIL PROTECTED]
Hi, I've been following this thread to learn Django better. Could you explain what the function of the empty Q is in your code, Enrico? What does 'or Q()' do? Cheers, Ross On Feb 7, 7:19 am, "Enrico" <[EMAIL PROTECTED]> wrote: > Hi Russel, > > Thanks a lot, it worked now. > > I can't drop the

Re: Change class name in Admin interface

2007-02-07 Thread Dirk Eschler
On Dienstag, 6. Februar 2007, Matias wrote: > Hi, > > I've a class named "Category", but this application must be in > Spanish, so I need it to be displayed on the Admin interface as > "Categoria". ¿how can I accomplish that? > > Here is the model definition: > > class Category(models.Model): >

Re: developing a new ajax website: places2go.org. some comments apreciated.

2007-02-07 Thread Kai Kuehne
Hey Pedro, On 1/10/07, pedro <[EMAIL PROTECTED]> wrote: > Hello guys, > > http://www.places2go.org: is a new site i'm developing, already > available in a beta version. Cool idea, but I don't like colors. Kai --~--~-~--~~~---~--~~ You received this message

Fwd: heads-up: changeset 4459 broke admin (?)

2007-02-07 Thread Jeremy Dunck
FYI, forwarding from django-users. Trunk admin is broken at the moment. -- Forwarded message -- From: Michael Radziej <[EMAIL PROTECTED]> Date: Feb 7, 2007 7:16 AM Subject: heads-up: changeset 4459 broke admin (?) To: django-developers@googlegroups.com Hi, we are still

Re: Reverse M2M

2007-02-07 Thread Enrico
Hi Russel, Thanks a lot, it worked now. I can't drop the related_name clause, in the Profile model I have two relationships to the User model: user (OneToOne) and friends (M2M). Then Django complains that the reverse query names clashes on those fields, forcing me to use a related_name. If I

passing arguments to the login_required decorator

2007-02-07 Thread Mike H
Hi all, I am using the login_required decorator form django.contrib.auth.decorators, but I want to override the second argument which specified which url it should redirect to if the user is not logged in. I'm pretty new to python and everything I've tried so far has just resulted in a syntax

Re: form_for_model and default values

2007-02-07 Thread HenrikG
On 11 Jan, 04:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > 2) I have a model with aUserfield so what I do (on the view) is the > following: > > Entry.fields['autor'].widget = forms.HiddenInput() > > if request.user.is_authenticated(): > Entry.fields['autor'].initial =

Admin convenience

2007-02-07 Thread David Abrahams
Hi, I'm building an app for scheduling conferences and am having a hard time finding a way to make it convenient for the scheduling administrator. Sessions need to be scheduled into time slots and it seems difficult to take advantage of the usual constraints to make scheduling work well. Here

Re: Newforms MultiValueField

2007-02-07 Thread Phil Powell
Thanks for the pointers. I soon came to realise that I did indeed need to subclass the MultValue classes, and currently have something like this: class PostcodeField(forms.MultiValueField): def compress(self, data_list): return ''.join(data_list) class PostcodeWidget(forms.MultiWidget):

Re: Change class name in Admin interface

2007-02-07 Thread Ramiro Morales
Matías, On 2/6/07, Matias <[EMAIL PROTECTED]> wrote: > > Hi, > > I've a class named "Category", but this application must be in > Spanish, so I need it to be displayed on the Admin interface as > "Categoria". ¿how can I accomplish that? > > Here is the model definition: > > class

Re: BdbQuit error

2007-02-07 Thread Dan Fairs
Hi, At the bottom of your traceback: > * /root/vulcano/jhonWeb/news/manipulators.py in complete > 35. > 36. for tagId in data.getlist('tags'): > 37. tag=Tag.objects.filter(id=tagId)[0] > 38. tag.parentTag = Tag.objects.get_or_create(value='Noticias') > [0] >

Re: save many to many data

2007-02-07 Thread Antonio
* mercoledì 07 febbraio 2007, alle 11:27, Russell Keith-Magee wrote : > > but the data are added also when I update the Previsione ... > > searching on group archive, I think I must implement a 'save' method > > into the Previsione class ... is correct ? > > I'm not sure I understand what you're

Re: newforms and umlaut

2007-02-07 Thread HenrikG
On 9 Jan, 02:16, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote: > On Mon, 2007-01-08 at 06:41 -0800, Hans.Rauch wrote: > > I have a class like this > > > class dms_itemForm ( forms.Form) : > > title = forms.CharField(label='berschrift') > > > If thisformis rendered, I see

Re: moving url's of my site

2007-02-07 Thread Kenneth Gonsalves
On 07-Feb-07, at 2:12 PM, skink wrote: > of course i can manually change urls.py and every links in my > templates which refer to absolute urls eg: dont use absolute urls in templates. > > app 1 to: > app 1 in both cases the url in the template should be '/app1/blah/' > > but i think it

moving url's of my site

2007-02-07 Thread skink
hi guys, let's assume i have my urls configured as follows: http://www.some_site.com/my_apps/app1/show_something/ http://www.some_site.com/my_apps/app2/show_something/ and some day i have to move them: http://www.some_site.com/someone/told/me/to/move/them/my_apps/app1/show_something/

The performance test of 9 leading web-frameworks

2007-02-07 Thread Alrond
Hello! I've tested 9 MVC-frameworks in performance and stability. The test determines the performance of frameworks in an identical conditions for the uncomplicated projects. The leader became Django! It is more faster than others.

Parsing uploaded files at creation time

2007-02-07 Thread [EMAIL PROTECTED]
I'm developing a small app that has a model that will include a need for the user to upload a list of things from a flat file upload (user list one user per line). What I want to do is to parse this file when the instance is created, and make additional DB calls to a separate table/model. What

BdbQuit error

2007-02-07 Thread mamcxyz
Hi, I have a view and only in the live site this error happend (I don't know why the debugger have something to do???) BdbQuit at /eventos/add/ * /root/django_src/django/core/handlers/base.py in get_response 67. # Apply view middleware 68. for middleware_method in

Background process within django

2007-02-07 Thread PeakDream
Hi, I'm developing a very simple intranet project with django. So far, everything works great. There are a few things I'm trying to accomplish and hasn't been able to find anything. I'm trying to some continuous background processing. There are a few basic requirements. One is to be able to

Change class name in Admin interface

2007-02-07 Thread Matias
Hi, I've a class named "Category", but this application must be in Spanish, so I need it to be displayed on the Admin interface as "Categoria". ¿how can I accomplish that? Here is the model definition: class Category(models.Model): name = models.CharField('Nombre',maxlength=40) description