Re: digg style pagination

2009-11-18 Thread Oleg Oltar
I am trying to use the application http://code.google.com/p/django-pagination/, that you proposed in the latest post. But getting an exception. Could you help to fix it please? TemplateSyntaxError at /section/home Caught an exception while rendering: 'request' Original Traceback (most recent

Re: casting unicode to model

2009-11-18 Thread neridaj
Thanks Karen but I'm just getting a 'NoneType' object has no attribute 'objects' with this code: def search(request): query = request.GET.get('q', '') model = request.GET.get('models', '') model_class = get_model(blog, model) results = [] if query: results =

Re: Initial values for formwizard form

2009-11-18 Thread Mark L.
On Nov 19, 1:28 am, geraldcor wrote: > Ok, > > Here is how I do it if I am using a regular form with a regular view: > > profile = request.user.get_profile() > form = MyForm('company': profile.defaultcompany, 'contact': > profile.defaultcontact, etc...}) > return

Re: how to run django with fastcgi, but not run as user "root" on linux

2009-11-18 Thread Fm
Hi, I'm am green-hand to linux. When I use /usr/bin/su nobody -c /usr/local/bin/python /home/admin/cc/ manage.py runfcgi method=threaded host=127.0.0.1 port=12345 it say "This account is currently not available." Because nobody's shell is /sbin/nologin,I could not use su? what is the normal way

Re: casting unicode to model

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 9:09 PM, neridaj wrote: > Hello, > > I have a select menu which I would like to use as a model selector in > a view but I keep getting 'unicode' object has no attribute 'objects' > because I need to cast this to type Model or something similar. How do >

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 8:28 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > I get the same problem also with an Assert False (a typical debug symbol > I've used with mod_python). > > http://dpaste.com/16/ > > no browser and no email, only logs. > > You seem to have put the

casting unicode to model

2009-11-18 Thread neridaj
Hello, I have a select menu which I would like to use as a model selector in a view but I keep getting 'unicode' object has no attribute 'objects' because I need to cast this to type Model or something similar. How do I go about doing that. Thanks, J -- You received this message because you

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 2:02 AM, Karen Tracey wrote: > On Wed, Nov 18, 2009 at 7:29 PM, Alessandro Ronchi < > alessandro.ron...@soasi.com> wrote: > >> >> >> http://dpaste.com/122205/ >> is my log file. >> >> > Traceback shows it is dying during the load of middleware. You

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 7:29 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > > http://dpaste.com/122205/ > is my log file. > > Traceback shows it is dying during the load of middleware. You would not get a pretty debug page for this even with DEBUG=True and running the

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 1:08 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > On Nov 19, 10:48 am, Alessandro Ronchi > wrote: > > With mod_wsgi I only get error logged into apache and not on the > interactive > > trackback in the browser, also If i set

Automatic swapping of field data?

2009-11-18 Thread Doug Blank
Django users, I have data that needs to be handled in two different manners, depending on if the user has certain permissions or not. For example, if a record is marked "private" and a user is not permitted, I want to substitute the word "PROTECTED" for a particular field's value. Now, of course

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Graham Dumpleton
On Nov 19, 10:48 am, Alessandro Ronchi wrote: > With mod_wsgi I only get error logged into apache and not on the interactive > trackback in the browser, also If i set DEBUG=True in my settings. > > Is there any way to handle the django trackback as usual? Is the

Re: Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
On Thu, Nov 19, 2009 at 12:48 AM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > With mod_wsgi I only get error logged into apache and not on the > interactive trackback in the browser, also If i set DEBUG=True in my > settings. > > Is there any way to handle the django trackback as

Internal server error 500 with mod_wsgi

2009-11-18 Thread Alessandro Ronchi
With mod_wsgi I only get error logged into apache and not on the interactive trackback in the browser, also If i set DEBUG=True in my settings. Is there any way to handle the django trackback as usual? -- Alessandro Ronchi SOASI Sviluppo Software e Sistemi Open Source http://www.soasi.com

Django website stats

2009-11-18 Thread Fabio Natali
Hi there! I have a Django based website with a few dozen users. Only logged users can enter the website and browse its pages. I wish I could set up a stats page, i.e. some sort of table listing how many accesses to the website for a given user. Specifically, I need: - per-user number of

Re: Inline admin objects question

2009-11-18 Thread Daniel Roseman
On Nov 18, 10:50 pm, Wayne wrote: > Thanks for your reply. > > My situation is a little bit more tricky. I have table A and table B. > Table B has several columns, two of which are tableID and resourceID. > Table B is related to table A in the following way: > select *

Re: Inline admin objects question

2009-11-18 Thread Wayne
Thanks for your reply. My situation is a little bit more tricky. I have table A and table B. Table B has several columns, two of which are tableID and resourceID. Table B is related to table A in the following way: select * from table B where b.tableID= (table A) and b.resourceID= (primary key of

Re: mod_wsgi django optimization

2009-11-18 Thread Graham Dumpleton
On Nov 19, 8:53 am, Alessandro Ronchi wrote: > On Wed, Nov 18, 2009 at 10:29 PM, Graham Dumpleton < > > > > > > graham.dumple...@gmail.com> wrote: > > > Yes, don't be so concerned in the first instance of trying to squeeze > > the most out of mod_wsgi configuration.

Re: AdminSite objects

2009-11-18 Thread bjudson
Oh, I see it's much easier to solve this problem by overriding the admin index view by putting something like this in the main URLconf: (r'^admin/$', 'admin_views.dashboard'), and then putting my dashboard view (and other custom views) into an admin_views.py file in the site root. As described

Re: Initial values for formwizard form

2009-11-18 Thread geraldcor
Ok, Here is how I do it if I am using a regular form with a regular view: profile = request.user.get_profile() form = MyForm('company': profile.defaultcompany, 'contact': profile.defaultcontact, etc...}) return render_to_response('forms/submit.html', {'form': form},

Re: db error after migrating from postgres to oracle

2009-11-18 Thread Ian
On Nov 18, 9:45 am, CDR wrote: > Hello, > > I've encountered this database exception error: "ORA-01830: date > format picture ends before converting entire input string." > > the sql that produced it was: > > sql > u'INSERT INTO "CBR" ("ORG_ID", "BCID", "NAME", "TCC",

Development to deployment

2009-11-18 Thread LeeRisq
I am working on a web site in a windows development environment, but the hosting plan that my client is currently using runs a Linux server. Can anyone tell me if there are significant hardships in making this transition between Windows development vs. Linux deployment. Thanks for reading. --

Re: mod_wsgi django optimization

2009-11-18 Thread Alessandro Ronchi
On Wed, Nov 18, 2009 at 10:29 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > Yes, don't be so concerned in the first instance of trying to squeeze > the most out of mod_wsgi configuration. You will get much more > dramatic gains by improving your database queries/performance and

AdminSite objects

2009-11-18 Thread bjudson
Hi- I'm very new to Django, and trying to set up a site with a customized admin section. Specifically, I'm trying to override the default admin index page with stats & useful links. This will require more than just modifying the template, so I'm trying to create a new AdminSite instance as

Re: mod_wsgi django optimization

2009-11-18 Thread Graham Dumpleton
On Nov 19, 7:36 am, Alessandro Ronchi wrote: > I'm running several django applications on different vhosts on a virtual > server. > In that virtual server  I have enough ram and cpu and I want to get the > fastest configuration for mod_wsgi. > > I don't have much

mod_wsgi django optimization

2009-11-18 Thread Alessandro Ronchi
I'm running several django applications on different vhosts on a virtual server. In that virtual server I have enough ram and cpu and I want to get the fastest configuration for mod_wsgi. I don't have much cuncurrent users on the same virtual host, but I have a lot of files for every page so I

Re: Django javascript includes

2009-11-18 Thread esatterwh...@wi.rr.com
I would say template tags are the nice little framework for doing this. you could create a tags the looks in a certain path for files ending in '.js' based on the model or application and join it with settings.MEDIA_URL.. have it return a string of text or a list of strings that you can iterate

ManyToMany question

2009-11-18 Thread Gretar
I'm making a game link site, where users can post links to their favorite web game. When people post games they are supposed to check what category the game falls into. I decided to allow many categories for each game since some games can fall into many categories. So the question is, how do I

Re: Inline admin objects question

2009-11-18 Thread Daniel Roseman
On Nov 18, 6:46 pm, Wayne wrote: > Hi, > > I am working with a legacy database which does not set foreign key > constraints at all between tables. I am wondering if I can still > create Inline admin interface by relating two objects through > different methods. If it is

Inline admin objects question

2009-11-18 Thread Wayne
Hi, I am working with a legacy database which does not set foreign key constraints at all between tables. I am wondering if I can still create Inline admin interface by relating two objects through different methods. If it is doable, what is the best way of doing it? Thanks, Wayne -- You

Re: same model field times in query result. How?

2009-11-18 Thread Preston Holmes
Its not clear how you differentiate one measure as speed or another as dir. Assuming only one has a link to another measure then you could do something like: results = Measurand.objects.exclude(entry__isnull=True).select_related () for speed in results: speed_avg = speed.avg_value

django ajax filtered fields

2009-11-18 Thread nuna
When using fields provided by this app there is no add link displayed above the widget. This is very unhandy because it's impossible to add a new related item, while editing the post. How can i accomplish this? I also had problems selecting objects when the foreignkey is to the same model, it

db error after migrating from postgres to oracle

2009-11-18 Thread CDR
Hello, I've encountered this database exception error: "ORA-01830: date format picture ends before converting entire input string." the sql that produced it was: sql u'INSERT INTO "CBR" ("ORG_ID", "BCID", "NAME", "TCC", "TDC", "TFC", "STARTPERIOD", "ENDPERIOD", "STATUS") VALUES (1, 1, Monthly

Re: Redirect problems

2009-11-18 Thread Zeynel
Adam and Skylar, The ISP's support just replied to my ticket. They set the urls.py as urlpatterns = patterns('', (r'^wkw1/$', 'sw1.wkw1.views.index'), (r'^admin/$', 'django.views.generic.simple.redirect_to', {'url': '/ admin/wkw1/lawyer'}), (r'^admin/wkw1/$',

Re: Set model form initial value?

2009-11-18 Thread Nick Arnett
On Wed, Nov 18, 2009 at 2:01 AM, Ilya Polosuhin wrote: > Just use "initial" keyword on creation form > class myForm(forms.Form): > test = forms.CharField(label = _('test'), max_length=255, required = > True) > > myForm(initial = {'test': 'test string'}). > > If

Re: Multiple level aggregate

2009-11-18 Thread Adam Knight
On Nov 16, 2009, at 12:12 PM, despy wrote: > Hi, > > I'm trying to get my head around a complex aggregate query and I could > do with some help. Say I have the following models > > StockMarket > | > Stock > | > StockPrice > > If StockPrice has price and date fields, and one price entry for

Re: Addree Book Contact Importer in django/python

2009-11-18 Thread Skylar Saveland
>   I need to import contacts of given email id/pwd from gmail,yahoo,hotmail > for django app. Please suggest? yaho: http://developer.yahoo.com/auth/ http://www.amaltas.org/show/using-yahoo-bbauth-with-django.html goog: http://code.google.com/p/gdata-python-client/ Not sure about hotmail. --

Re: Redirect problems

2009-11-18 Thread Skylar Saveland
What are the details of the error? On Nov 18, 7:06 am, Zeynel wrote: > I've been trying to redirect > > /admin/ to /admin/wkw1/lawyer > > The suggestions from my previous > posthttp://groups.google.com/group/django-users/msg/67c4594a4083bd45 > did not work. > > I read the

Re: Redirect problems

2009-11-18 Thread Adam Knight
On Nov 18, 2009, at 6:06 AM, Zeynel wrote: > I've been trying to redirect > > /admin/ to /admin/wkw1/lawyer > > The suggestions from my previous post > http://groups.google.com/group/django-users/msg/67c4594a4083bd45 > did not work. > > I read the redirect section in the documents as

Re: ModelForm and fieldsets

2009-11-18 Thread Skylar Saveland
> that was my mistake - had an error in the template - it wors no. > But according to this, I've another problem - fields which are foreign > keys don't get rendered. Typos? Wrong names? Maybe try to define the fields explicitly with the widgets and choices that you want (but then the save

Re: bulk product import to satchmo

2009-11-18 Thread Skylar Saveland
My buddy did a talk on generically importing data from excel for pyatl. http://www.mefeedia.com/watch/25167971 You can check out some code here: http://code.google.com/p/django-batchimport/ Not sure how it will do with this satchmo business. > there is no script for parsing.  I'm importing

Re: ModelForm and fieldsets

2009-11-18 Thread Benjamin Wolf
Hi, that was my mistake - had an error in the template - it wors no. But according to this, I've another problem - fields which are foreign keys don't get rendered. Here is my code: class ContactForm(BetterModelForm): class Meta: model = Disposal fieldsets = (('row1',

Re: CommaSeparatedIntegerField - no suitable widget?

2009-11-18 Thread anentropic
Ok, so the model, the formfield and the widget each take a 'choices' attribute. You have to specify the choices on the formfield for any choices to show up. incidentally the styling of CheckboxSelectMultiple seems to be buggered in the admin, on a Mac at least (FF and Safari) On Nov 18, 12:06 

Re: ModelForm and fieldsets

2009-11-18 Thread Skylar Saveland
If you haven't already, you could instantiate one in the shell and render/inspec it there. You will at least be able to see what might be a problem with your class/python-code vs what might be wrong at the template level. On Nov 18, 9:27 am, Benjamin Wolf wrote: > Hi there, > >

ModelForm and fieldsets

2009-11-18 Thread Benjamin Wolf
Hi there, I'm using a ModelForm and had the wish to use fieldsets. After a short search I've found this: http://pypi.python.org/pypi/django-form-utils/0.1.5 Seems to be what I want. So I've installed it and changed my form from ModelForm to BetterModelForm. It works so far, but when I try to

Re: DJango

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 3:53 AM, victor wrote: > Hi, All. > > I'm newbie to DJango / BSD lincense. > > I have to create web application + desktop widgets. Web application > will use django, and desktop widget will use django ORM. Can I do this > under djnago license: >

Re: How to use subqueries in django

2009-11-18 Thread Radhikavk
thank you sir i found the solution -- View this message in context: http://old.nabble.com/How-to-use-subqueries-in-django-tp26387486p26408019.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups

Re: Problem with serving static files

2009-11-18 Thread igor
>>> urls.py: >>> urlpatterns = patterns('', >>> (r'^polls/', include('mysite.polls.urls')), >>> (r'^site_media/(?P.*)$', 'django.views.static.serve', >>> {'document_root': '/mysite/media/'}), >>> ) Since I always start Django in its "root" directory, I put something like:

Re: How to use subqueries in django

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 2:15 AM, Radhikavk wrote: > > in one query they have giver or conditions > but i need > i wil have one common query like > list=rooms.objects.all() # this is common query i m using > > and if the condition given like room status,type etc then i need

Re: Login Error

2009-11-18 Thread Karen Tracey
On Wed, Nov 18, 2009 at 12:12 AM, Denis Bahati wrote: > Hi All, > I have created a login screen for users of the site which is like User > Profile and uses the username and password from django users. When i try to > login to my view i get the error below. > > Environment:

Re: Problem with serving static files

2009-11-18 Thread Benjamin Wolf
Thanks Jeremy, got it. jeremyrdavis schrieb: > The document root specified in urlpatterns should match the directory > where your files are located. You have "/mysite/media/" in your > urlpatterns and "C:\django_projects\mysite\media" in your post. Make > sure those match. > > > On Nov 18, 6:56

Re: Problem with serving static files

2009-11-18 Thread Denis Bahati
how do you make them similar? because its also a problem to with TinyMCE. On Wed, Nov 18, 2009 at 4:13 PM, jeremyrdavis wrote: > The document root specified in urlpatterns should match the directory > where your files are located. You have "/mysite/media/" in your >

Re: Problem with serving static files

2009-11-18 Thread jeremyrdavis
The document root specified in urlpatterns should match the directory where your files are located. You have "/mysite/media/" in your urlpatterns and "C:\django_projects\mysite\media" in your post. Make sure those match. On Nov 18, 6:56 am, "Benjamin W." wrote: > Hi there, > >

Re: bulk product import to satchmo

2009-11-18 Thread Bobby Roberts
Hi Francois - there is no script for parsing. I'm importing CSV files right into the database through the import function in myphpadmin. I've populated the following tables: product_price product_product product_productpricelookup product_product_category the items are not showing in the

Problem with serving static files

2009-11-18 Thread Benjamin W.
Hi there, I'm new to django and got my first little problem. I want to use a css file in my template. So I read this: http://docs.djangoproject.com/en/dev/howto/static-files/ I set up everything, but I don't get the file. My config: urls.py: urlpatterns = patterns('', (r'^polls/',

CommaSeparatedIntegerField - no suitable widget?

2009-11-18 Thread anentropic
I am trying to use a CommaSeparatedIntegerField in one of my models... there doesn't seem to be a suitable widget for editing this field though? Seems like one of the 'select multiple' widgets would be an obvious choice. SelectMultiple seems the default widget for it in admin, but it renders an

Looking for Django/Apache/Plesk consultant

2009-11-18 Thread Hooshyar
Hello Djangoists, I am looking for a consultant who knows how to configure Django in relationship to Apache. This is a paid gig. please contact me at my e- mail hnara...@hanzinet.com we can discuss details. Brief statement of the problem I have had problem configuring Django to handle two

Redirect problems

2009-11-18 Thread Zeynel
I've been trying to redirect /admin/ to /admin/wkw1/lawyer The suggestions from my previous post http://groups.google.com/group/django-users/msg/67c4594a4083bd45 did not work. I read the redirect section in the documents as suggested

Re: how to run django with fastcgi, but not run as user "root" on linux

2009-11-18 Thread Tom Evans
On Wed, Nov 18, 2009 at 8:25 AM, Fm wrote: > Hi all, > I have write a script in /etc/rc.d/init.d so that Django can start > with my server. > It may look like > start () { >echo -n $"Starting $prog: " > /usr/local/bin/python /home/admin/cc/manage.py runfcgi

how to run django with fastcgi, but not run as user "root" on linux

2009-11-18 Thread Fm
Hi all, I have write a script in /etc/rc.d/init.d so that Django can start with my server. It may look like start () { echo -n $"Starting $prog: " /usr/local/bin/python /home/admin/cc/manage.py runfcgi method=threaded host=127.0.0.1 port=12345 } Then I can see ps aux|grep manage root

DJango

2009-11-18 Thread victor
Hi, All. I'm newbie to DJango / BSD lincense. I have to create web application + desktop widgets. Web application will use django, and desktop widget will use django ORM. Can I do this under djnago license: 1) Desktop widget is closed source. 2) Sell web application / desktop widget (maybe also

Re: How to lay out large, *modular* website in Django.

2009-11-18 Thread zimnyx
Thank you for replies :-) I forgot to mention important thing: Those website modules will probably be run on separate hosts (they can be put on different hosts or virtual hosts, but still use the same database) .. so one point in "What is common between them": "global configuration (database uri,

Re: bulk product import to satchmo

2009-11-18 Thread Francois Verbeek
what's your model like? What's your import script like? What's your sheet like? We need an idea of what you're trying to do before we can help. I've personally always preferred writing a parser for the xls file (usually in csv form instead of xls, though) and directly create/use/save the model

Re: Set model form initial value?

2009-11-18 Thread Ilya Polosuhin
Just use "initial" keyword on creation form class myForm(forms.Form): test = forms.CharField(label = _('test'), max_length=255, required = True) myForm(initial = {'test': 'test string'}). If you use form that generated from model: class myForm(forms.Form): class Meta: model =

how best to allow admin users to edit only one "site"

2009-11-18 Thread django_jedi
Hi all, Let's say I have a django app that feeds content to multiple sites. I have an admin user for "Site1" and an admin user for "Site2". I would like to set things up so that the guy from "Site1" can't see/edit the content for "Site2". What's the best way to set this up? Thanks for your