Re: Setting DJango and Stackless

2009-06-08 Thread Khanage
I ran into this same issue, you will need to recompile python with the following (somewhat unintuitive option): --enable-unicode=ucs2, and then recompile psycopg2. I've gotten that far with stackless on my machine, and runserver, etc. works ok. On May 30, 3:25 am, Chandrashekar Jayaraman

Callable objects inside a context

2009-06-08 Thread EricR86
Hello, I have a small issue in terms callable objects inside of contexts. I'm having trouble figuring out how to have the call evaluated everytime the context is used/rendered. An example: some_context = { 'random': random(), } def some_view(request): return

display title from master record

2009-06-08 Thread jayvandal
I have the four models , 1. Patient has 2.doctors and 3.pills the 3.Pills have 4.rders In the aadmin screen the displays are in Doctors Orders Patients Pills I would like to be able add a pillto the file and then add all orders for that pill On my order screen, how can I display the title from

Re: What is available IN Django compared to other frameworks?

2009-06-08 Thread Kenneth Gonsalves
On Monday 08 June 2009 21:07:57 Necmettin Begiter wrote: > Your best bet would be using a CMS like Joomla, because, don't get me > wrong, but if you do not know the difference between a web application > and a web framework, you better stick to already-mature web > applications (since you are

populating a dropbox with a directory listing.

2009-06-08 Thread Bobby Roberts
Hi group. I need to pull a directory listing and populate a dropbox. I know how to do this with a queryset but how could i do it with something like this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Error trying to add a new user in the admin site

2009-06-08 Thread Kevin Audleman
I go into the admin section of my site, click on Users, then on the 'Add User' button. It takes me to a screen that asks me to put in a username and password and click 'Save'. At this point I get an error: ValueError at /admin/auth/user/add/form_url invalid literal for int() with base 10:

Re: dates() and annotate()

2009-06-08 Thread Don Spaulding
On Jun 8, 3:54 pm, Alex Gaynor wrote: > On Mon, Jun 8, 2009 at 3:42 PM, Don Spaulding wrote: > > > > > > > Hi there, > > > While playing around with the aggregation support in trunk, I came up > > with the need for the following SQL query: > > >

About extending user profile

2009-06-08 Thread ariest
Im developing a childcare app and I have a problem when I want to relate an object of a table with a UserProfile field so for example: user:some_parent In a view, I want to see only the childs of that parent. In python manage.py shell: -Example: Parent case-

Displaying select box data back to the same form - with correct value already selected.

2009-06-08 Thread NealWalters
For simple input fields, I'm echoing back the data from database to form like this: Your Domain (example: JohnDoe.com) If I don't put the "if" statement there, I get the value "None" appearing, which is not desireable from a user's perspective. In this case "session" is the name of

poll tutorial admin question

2009-06-08 Thread zignorp
Hello, I'm getting going with the tutorial, it's so exciting to see the admin panel, but I've got a problem with the breadcrumbs. So I'm working from this page: http://docs.djangoproject.com/en/dev/intro/tutorial02/#intro-tutorial02 and when I select my poll to change, it says: Home › Polls ›

Newbie question regarding django-authopenid

2009-06-08 Thread DrBloodmoney
For those who have used django-authopenid [1], can you tell me if it interferes with the built-in django user authentication system (users, permissions, groups, etc). I am going to attempt to get it running on a small project, but I won't bother if it interferes with auth. Thank you in advance

Displaying a checkbox/list from database back onto a Django form

2009-06-08 Thread NealWalters
Template/Form looks like this: English: Spanish: Portuguese: Database model defines column: languages = db.StringListProperty() #stores multiple languages I stored data into Google/BigTable like this: session.languages = self.request.get_all('language') That part

Re: Django Registration templates not talking to my other pages. Sometimes.

2009-06-08 Thread Jashugan
On Jun 4, 2:45 pm, Matt wrote: > It looks like you're right and the login page isn't actually logging > users in. > > Any idea why that might be? I'm using the auth.login view and a > template that looks like this: Your template code looks fine. > Any thoughts on what

Overwrite "list_display" in a new view

2009-06-08 Thread Tom
I use the admin.ModelAdmin with a list_display to display columns on the edit list page. I need another one , looking the same as the current edit list page but with other columns taken from my model. Is there a way to override easily the list_display in a new view to do that ? Thank you.

Re: What is available IN Django compared to other frameworks?

2009-06-08 Thread CLIFFORD ILKAY
On 08/06/09 11:37 AM, Necmettin Begiter wrote: > On Mon, Jun 8, 2009 at 16:39, Olav wrote: >> I am convinced that Django is a great framework, but I need to know >> how much of the stuff I might need is available or can easily be >> integrated? >> >> How much is available

Re: What is available IN Django compared to other frameworks?

2009-06-08 Thread CLIFFORD ILKAY
On 08/06/09 11:30 AM, Masklinn wrote: > On 8 Jun 2009, at 15:39 , Olav wrote: >> I am convinced that Django is a great framework, but I need to know >> how much of the stuff I might need is available or can easily be >> integrated? >> >> How much is available compared to Drupal, Joomla or

Re: Variable Base Template

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 3:19 PM, pingwin wrote: > > Hi, > > This is frustrating and against a true MVC methodology. I want to have > something like this for the designer in the template. > > {% if user.is_authenticated %} > {% extends "auth_base.html" %} > {% else %} > {%

Re: Seeing form validation errors

2009-06-08 Thread Karen Tracey
On Mon, Jun 8, 2009 at 3:57 PM, zayatzz wrote: > > Well now this is working just fine: > > [snip AccountForm] > > But this (code below) still does not return me any error messages from > form validation. > >form = AccountForm(request.POST) >

Variable Base Template

2009-06-08 Thread pingwin
Hi, This is frustrating and against a true MVC methodology. I want to have something like this for the designer in the template. {% if user.is_authenticated %} {% extends "auth_base.html" %} {% else %} {% extends "base.html" %} {% endif %} However this obviously fails. I do not think it

Re: Type Error str is not callable in base.py

2009-06-08 Thread grElement
Thanks Karen - I think I will start doing that from now on. Thanks everyone else - For now I'm just rolling back a bit before I started getting the error and go from there. It seems that my project scope has changed a bit midstream anyway so I guess this really isn't the end of the world. If I

Re: Getting radio boxes with ModelForm

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 3:55 PM, Andy Dietler wrote: > > Thanks. > > How do I overwrite the definition of rating, like this?: > > class Rating(models.Model): >rating = models.IntegerField() > > > class ShowForm_Rate(forms.ModelForm): >class Meta: >model =

Re: Getting radio boxes with ModelForm

2009-06-08 Thread Andy Dietler
Thanks. How do I overwrite the definition of rating, like this?: class Rating(models.Model): rating = models.IntegerField() class ShowForm_Rate(forms.ModelForm): class Meta: model = Rating rating = forms.ChoiceField(widget=forms.RadioSelect

Re: dates() and annotate()

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 3:42 PM, Don Spaulding wrote: > > Hi there, > > While playing around with the aggregation support in trunk, I came up > with the need for the following SQL query: > > SELECT >DATE_TRUNC('day', datestamp) AS rec_day, >COUNT(id) AS

Testing Django Templates

2009-06-08 Thread Andrew Fong
I'm trying to get into a better testing flow with Django. One of things I'm trying to figure out how to test are templates. Using the Django Test Client works fine, for instance, in detecting whether I have a missing template tag (because it'll explode) or if I don't pass a particular variable to

dates() and annotate()

2009-06-08 Thread Don Spaulding
Hi there, While playing around with the aggregation support in trunk, I came up with the need for the following SQL query: SELECT DATE_TRUNC('day', datestamp) AS rec_day, COUNT(id) AS count FROM stats_record GROUP BY rec_day How would I construct this same query via the ORM?

a DRY ModelAdmin?

2009-06-08 Thread byron
So I am implementing a couple custom admin interfaces for a project i am working on. I wanted to limit the choices for a few of my models, so i overrode the ModelAdmin.queryset method and that worked well. But the one thing i noticed was that any other models (one being Study) that have

Re: "manage.py install" not supported?

2009-06-08 Thread Daniel Roseman
On Jun 8, 6:12 pm, Bo Zhao wrote: > sorry all, i find it..in the 1.0 version, the subcommand install is removed. > but my question is how to automatically import a model without edit the > INSTALLED_APPS? > > On Mon, Jun 8, 2009 at 1:08 PM, Bo Zhao

Re: Getting radio boxes with ModelForm

2009-06-08 Thread Daniel Roseman
On Jun 8, 8:23 pm, Andy Dietler wrote: > I'm trying to make one of the fields in my model display radio buttons > with the options 1-5. I can't find a way to do this with a model form > and I can't get anything I find in documentation to work properly. > > What I have

Re: Seeing form validation errors

2009-06-08 Thread zayatzz
Well now this is working just fine: class AccountForm(forms.Form): username = forms.CharField(max_length=100, help_text="Enter Username of your account", label="Your username") email = forms.EmailField(max_length=100, help_text="Enter your e-mail address", label="Your e-mail

Re: Blog entry with multiple categories

2009-06-08 Thread Tomasz Zieliński
On 8 Cze, 17:31, grimmus wrote: > Hi, > > I have a simple blog application > > I would like to be able to create a post and assign it to multiple > categories > >     category = models.ForeignKey(BlogCategory) ForeignKey allows you to assign post only to one

Getting radio boxes with ModelForm

2009-06-08 Thread Andy Dietler
I'm trying to make one of the fields in my model display radio buttons with the options 1-5. I can't find a way to do this with a model form and I can't get anything I find in documentation to work properly. What I have below results in me getting the following error: TypeError: __init__() got

Re: What template: admin site

2009-06-08 Thread David
Thanks Alex! Now I know where to start. On Jun 8, 10:18 am, Alex Gaynor wrote: > On Mon, Jun 8, 2009 at 12:14 PM, David wrote: > > > Hello, > > > Following the online tutorial I have created "mysite" project. After I > > have logined into admin, I can

Permission Denied: /tmp/python.cache_root

2009-06-08 Thread jmat
I'm getting an error using Django 1.0 when trying to log a new user in. When I call login(request) On a new user I will occassionally (not very often) get an error (the cache number values will be different): Permission Denied: /tmp/python.cache_root/8/7/2 Which is an: OSError in

Re: What template: admin site

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 12:14 PM, David wrote: > > Hello, > > Following the online tutorial I have created "mysite" project. After I > have logined into admin, I can see Auth --- Mysite Sites. > > Now I would like to use the same layout/template for my user home page > as

What template: admin site

2009-06-08 Thread David
Hello, Following the online tutorial I have created "mysite" project. After I have logined into admin, I can see Auth --- Mysite Sites. Now I would like to use the same layout/template for my user home page as this admin page. I have read django/contrib/admin/sites.py but could not find

Re: "manage.py install" not supported?

2009-06-08 Thread Bo Zhao
sorry all, i find it..in the 1.0 version, the subcommand install is removed. but my question is how to automatically import a model without edit the INSTALLED_APPS? On Mon, Jun 8, 2009 at 1:08 PM, Bo Zhao wrote: > Hi all, > > a quick and mightbe stupid question, I want to

"manage.py install" not supported?

2009-06-08 Thread Bo Zhao
Hi all, a quick and mightbe stupid question, I want to use the subcommand install within manage.py, but it seems not exist. Since I need to automatically import model but not manually edit the INSTALLED_APPS. anyone has some idea on this? best, Bo -- Bo, Zhao GIS Intern, Center for

Re: Problems with view... not sure how to get the data to my template

2009-06-08 Thread Mitch Anderson
Well, I guess a good nights sleep did me well I discovered my error, the problem was within my loops... I had to move one of my appends outside the inside for loop... for a in range_list: for b in used_number_list: if str(b) == str(a): try: prod

Re: Seeing form validation errors

2009-06-08 Thread zayatzz
I think i already tried that, Michael, and i got some error that had something to do with nonetype... since there is no pwd in data, you cant compare if its equal or not to '' Alan. On 8 juuni, 17:24, Michael wrote: > On Mon, Jun 8, 2009 at 10:09 AM, zayatzz

Re: How to group_by..

2009-06-08 Thread Darren
Nice, thanks for the update, Russell and Alex ! -d On Jun 5, 10:10 pm, Russell Keith-Magee wrote: > On Sat, Jun 6, 2009 at 7:55 AM, Alex Gaynor wrote: > > > On Fri, Jun 5, 2009 at 12:03 PM, Darren wrote: > > >> That's

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Karen Tracey
On Mon, Jun 8, 2009 at 5:39 AM, Chris Stoyles wrote: > Hi Thomas, > > The reason I want to be able to rollback (but still commit by log entries) > is because it is sometimes valid for this particular view to throw an > exception and fail. If this happens, I need to rollback

Re: What is available IN Django compared to other frameworks?

2009-06-08 Thread Necmettin Begiter
On Mon, Jun 8, 2009 at 16:39, Olav wrote: > > I am convinced that Django is a great framework, but I need to know > how much of the stuff I might need is available or can easily be > integrated? > > How much is available compared to Drupal, Joomla or DotNetNuke for >

Re: Problems with view... not sure how to get the data to my template

2009-06-08 Thread Mitch Anderson
On Mon, Jun 8, 2009 at 3:46 AM, Chris Stoyles wrote: > The problem is that there is no "number_list" key in your context, there is > only a "range" and "range_list" key (take a look at where you call > "render_to_response"). I think what you want to do is actually pass your >

Blog entry with multiple categories

2009-06-08 Thread grimmus
Hi, I have a simple blog application I would like to be able to create a post and assign it to multiple categories Currently my model looks like below. I was thinking i could render the categories in the admin as checkboxes and then check multiple ones, if required, but i am not really sure

Re: What is available IN Django compared to other frameworks?

2009-06-08 Thread Masklinn
On 8 Jun 2009, at 15:39 , Olav wrote: > I am convinced that Django is a great framework, but I need to know > how much of the stuff I might need is available or can easily be > integrated? > > How much is available compared to Drupal, Joomla or DotNetNuke for > example? Drupal and Joomla are

Re: how many levels allowed in models

2009-06-08 Thread phred78
Cool tip! > You're allowed to do admin.site.register([Model1, Model2, Model3]) to > register multiple models.  Note the creation of the list there, not directly > calling the method with the objects as argumne.ts --~--~-~--~~~---~--~~ You received this message

Re: how many levels allowed in models

2009-06-08 Thread Alex Gaynor
On Mon, Jun 8, 2009 at 5:29 AM, phred78 wrote: > > I think you need separate admin registers, like so: > > admin.site.register (Patient) > admin.site.register (Doctor) > admin.site.register (Pills) > admin.site.register (Orders) > > You'd only put two together if you created

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
Chris Stoyles schrieb: > Hi Thomas, > > The reason I want to be able to rollback (but still commit by log entries) > is because it is sometimes valid for this particular view to throw an > exception and fail. If this happens, I need to rollback any model objects > that have been created and

Re: Seeing form validation errors

2009-06-08 Thread Michael
On Mon, Jun 8, 2009 at 10:09 AM, zayatzz wrote: > > So i change pwd and pwdc to required=False and in clean i do > if pwd in data (or if ["pwd"] not in data): >if data.get("pwd") != data.get("pwdc"): >raise forms.ValidationError("Passwords do not match")

Re: Seeing form validation errors

2009-06-08 Thread zayatzz
So i change pwd and pwdc to required=False and in clean i do if pwd in data (or if ["pwd"] not in data): if data.get("pwd") != data.get("pwdc"): raise forms.ValidationError("Passwords do not match") return data and i get errorfree clean function? Alan On Jun 8, 4:29 pm, Michael

What is available IN Django compared to other frameworks?

2009-06-08 Thread Olav
I am convinced that Django is a great framework, but I need to know how much of the stuff I might need is available or can easily be integrated? How much is available compared to Drupal, Joomla or DotNetNuke for example? If I want to use another framework and have it appear as the same site,

Re: Seeing form validation errors

2009-06-08 Thread Michael
On Mon, Jun 8, 2009 at 2:05 AM, zayatzz wrote: > > Great :). Thanks... > > Wish i had read your post more thoroughly the first time. > > This takes care of my second problem, but what about the first one - > why do password fields need to be filled? Because empty(or

Re: model form validation always failing

2009-06-08 Thread watad
the form is working fine now , actually my form was inside another form , that was the problem On May 22, 6:55 pm, watad wrote: > hi karen , actually im runing this code , after submit i can see all > the data inside the model ,only the filefield resume is empty , of > course

Re: Switching backend database on the fly?

2009-06-08 Thread John
One more requirement.. 4. The application must be self contained i.e contain its own django installation (which has the quick start web server) and sqlite db module. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Switching backend database on the fly?

2009-06-08 Thread John Baker
I need to write a small application and considering django but am wondering how the model backend copes with the following scenario.. The admin user needs to be able to upload/download new dbs and switch the current backend database file and run the app portably on different machines. The

Re: Searching disparate databases

2009-06-08 Thread John
I would have your internal model how you like for the best application design and then write cron scripts that import into your main db from the other disparate format databases. Have a field in your internal model so you know the original source of each entry. Reimport when the third party DBs

Re: Using Django authentication for web pages outside Django?

2009-06-08 Thread Adam Stein
Thanks for the link. The description sounds like just what I need. On Fri, 2009-06-05 at 20:46 -0700, Graham Dumpleton wrote: > Have a look at: > > http://www.openfusion.com.au/labs/mod_auth_tkt/ > > Graham > > On Jun 6, 6:26 am, Adam Stein wrote: > > I'm trying to

Re: Using Django authentication for web pages outside Django?

2009-06-08 Thread Adam Stein
Thanks for responding and for the idea. I'm also migrating, but security seems to be a bigger deal than getting the rest migrated at the moment, hence the need to authenticate for the old stuff. On Fri, 2009-06-05 at 16:43 -0700, BenW wrote: > I did something similar while migrating an old app

Re: Place two or more inputs per line in django admin.

2009-06-08 Thread Denis Cheremisov
Solved it, replace get_fieldsets with my custom function, returning: [(None, {'fields': [('field1','field2),]})] On Jun 5, 5:23 pm, Denis Cheremisov wrote: > I saw the method using fieldsets, by grouping several fields in a > tuple. But this method didn't suit

Re: how many levels allowed in models

2009-06-08 Thread phred78
I think you need separate admin registers, like so: admin.site.register (Patient) admin.site.register (Doctor) admin.site.register (Pills) admin.site.register (Orders) You'd only put two together if you created some special instructions for the admin. Then you'd have something like:

Re: how many levels allowed in models

2009-06-08 Thread Russell Keith-Magee
On Mon, Jun 8, 2009 at 1:45 PM, jayvandal wrote: > > I have four tables > 1 Patient >      2 has many doctors >            3  doctor issues pills >                    4  order many pills > when I run syncdb I get the 3 levels showing in adminstrative screen. > I can't get it

Searching disparate databases

2009-06-08 Thread Amit Sethi
Hi all , I am trying to develop a web app that searches products on some local stores and give the price.Now I can obviously have a format for stores to feed my database but rather than that .What I want is that the local stores be able to dump their database/feeds on my Server . It

Re: Problems with view... not sure how to get the data to my template

2009-06-08 Thread Chris Stoyles
Hi Mitch, I haven't read through your example in detail, but just glancing over it I think that I can see the mistake you're making The problem is that there is no "number_list" key in your context, there is only a "range" and "range_list" key (take a look at where you call

Mail queue

2009-06-08 Thread phred78
Hello everyone, Besides django-mailer, has anyone had experience on how to queue e- mail? I'm writing an application that sends newsletters to roughly around 3000 subscribers and I don't want the hosting company - mediatemple - complaining about reaching their 500 e-mail per hour limit. Are

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Chris Stoyles
Hi Thomas, The reason I want to be able to rollback (but still commit by log entries) is because it is sometimes valid for this particular view to throw an exception and fail. If this happens, I need to rollback any model objects that have been created and saved up to the point at which the view

Re: request.session in template tag?

2009-06-08 Thread BluMarble
Thanks to a comment on my blog: the below is null and void: the request object can be retrieved directly from context: context ['request']. On Jun 2, 2:55 pm, BluMarble wrote: > On Jun 1, 7:53 pm, "bax...@gretschpages.com" > wrote: > > > I'm

Re: how to override ordering in date-based generic views

2009-06-08 Thread V
if I'm not mistaken then the default ordering is used, that is given by your model's Meta class [1] otherwise, if you need a special ordering you might want to define your own model manager with a method that does just what you want, and call that method for the queryset [1]:

Re: How to delete a setting

2009-06-08 Thread V
you can run ./manage.py test yourapp with --settings=mysetting so, I would recommend to create a settings file with the given setting left out V On Jun 7, 1:51 pm, Julien Phalip wrote: > Hi, > > In a unit test, I'd like to test the behaviour of a middleware in the > absence

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
Hi Chris, please explain in more depth what you want to do. If you do rollback, all changes won't be written to the database. Even all savepoints won't be stored. Why do you want to rollback? If you want your changes to get saved, you need to call transaction.commit() at the end. ChrisStoyles

Re: Seeing form validation errors

2009-06-08 Thread zayatzz
Great :). Thanks... Wish i had read your post more thoroughly the first time. This takes care of my second problem, but what about the first one - why do password fields need to be filled? Because empty(or nonexisting data) fields cannot be compared in 2nd if ? Then what is the syntax for

Re: Some ForeignKeys show up as list_filters, some don't.

2009-06-08 Thread Rodrigo Cea
Found the answer here; http://groups.google.com/group/django-users/browse_thread/thread/89b4146892801ed4/17f2d26e10709ba0?lnk=gst=foreignkey+list_filter#17f2d26e10709ba0 Short version: "If you only have one record in the table related to your foreign key, then the filter list will not show up