Re: settings.py seems to be cached or stuck

2009-11-24 Thread Crispin Wellington
On Tue, 2009-11-24 at 21:52 -0800, Graham Dumpleton wrote: > Your imagination is running amuck, no such thing happens. You can > quite happily run multiple Django instances in embedded mode, they > just need to be separated into distinct Python sub interpreters, which > is the default behaviour of

Re: How to unregister model?

2009-11-24 Thread Hanne Moa
2009/11/25 Tomasz Zieliński : > That patch is a hack that requires modifying live instance of Django, > moreover I don't know what is influenced by it as I'm not that > familiar > with inner workings of model layer, so using it would be troublesome > for me. > > So it seems that I have to write cus

Re: german umlaute on search querys

2009-11-24 Thread Hinnack
Hi Karen, thanks for your reply it means so far I must do a: qs = search[query].encode('iso-8859-1') before I add the qs to a Q object of a queryset. Only in this case I get results. the full codepart looks like: decoder = simplejson.JSONDecoder() search = decoder.decode(request.POST['search']

Re: Best way to use django for sql with raw LIKE statement

2009-11-24 Thread valhalla
Oh and as for breaking into fields its not really an option in the cases I need unfortunately. he actual lookup would not be as log/ complex as the example but basically for the best functionality users need to be able to do wildcard searches. On Nov 25, 3:45 pm, Tim Valenta wrote: > It sounds

Re: Best way to use django for sql with raw LIKE statement

2009-11-24 Thread valhalla
I knew I forgot to mention somthingI am (not by choice) on a mssql DB and regex is not really an option. Thanks for the reply though, I had been using regex for this before our db moved to MS On Nov 25, 3:45 pm, Tim Valenta wrote: > It sounds like you've been using the right sorts of methods

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Graham Dumpleton
On Nov 25, 4:52 pm, Graham Dumpleton wrote: > On Nov 25, 3:23 pm, Crispin Wellington > > wrote: > > Have a read of the mod_wsgi documentation, particularly the > > page:http://code.google.com/p/modwsgi/wiki/ApplicationIssues > > > Because Django uses environment variables to access the setting

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Graham Dumpleton
On Nov 25, 3:58 pm, Karen Tracey wrote: > On Tue, Nov 24, 2009 at 11:32 PM, Tim Valenta > wrote: > > > > > > > Yeah, production servers aren't really very friendly to changes. > > Languages like PHP are specifically built to circumvent such woes. > > You would have to actually bounce apache in

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Graham Dumpleton
On Nov 25, 3:23 pm, Crispin Wellington wrote: > Have a read of the mod_wsgi documentation, particularly the > page:http://code.google.com/p/modwsgi/wiki/ApplicationIssues > > Because Django uses environment variables to access the settings file, > all kinds of strife can occur when running Djan

Re: reversing URLs

2009-11-24 Thread Tim Valenta
Holy cow you're right. That was an extreme case of needing another pair of eyes. I thought I had tested the view after using that syntax, but I must not have tested the right scenario. Many thanks. I will check it out in the morning :) Tim Sent from my iPod; pardon any typos and poor grammar!

Re: reversing URLs

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 11:20 PM, Tim Valenta wrote: > Thanks for the reply. Yes, I can give a bit more info on it. > > So, for starters, my (abbreviated) main url conf looks like this: > >urlpatterns = patterns('', >(r'^surveys/', include('servicetrac.surveys.urls')), >) > > ...

Re: calendar.js can't find variable gettext

2009-11-24 Thread Todd Blanchard
Yep, I solved this by ripping and copying some code out of admin/sites.py and adding a url conf for it. It works now, but this should be included by default through the widget media dependency system. Not very slick. I tried filing a bug and the submission was rejected as spam. -Todd Blanchar

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Tom
That is all really helpful; thanks very much everybody. My production environment is Apache 2.2.9 on Fedora, so it looks as if the solution Karen suggests will be workable, and I think I will give that a try as it looks close to ideal. Thanks again all; much appreciated. Tom -- You received th

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 11:32 PM, Tim Valenta wrote: > Yeah, production servers aren't really very friendly to changes. > Languages like PHP are specifically built to circumvent such woes. > You would have to actually bounce apache in order to get the changes > to take. > > This is why the develop

Re: Best way to use django for sql with raw LIKE statement

2009-11-24 Thread Tim Valenta
It sounds like you've been using the right sorts of methods for that job, but the complexity of the query is getting to be too much :) There's a 'regex' lookup... http://docs.djangoproject.com/en/dev/ref/models/querysets/#regex That's a pretty intense example text parsing search. I think the us

.mo file is empty - please help

2009-11-24 Thread Igor
Hi, I'm developing on windows and using gnu gettext... I run "django-admin.py makemessages -a" and it creates the .po fine, but then when I do my translations and run 'django-admin.py compilemessages' . The result is an "empty" .mo file (367 bytes - only headers as far as I understand). This is a

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
Oh, geez you are NEVER going to believe what caused this error. This causes it: user = authenticate(user_name) This makes it work: user = authenticate(username = user_name) The error is vague because authenticate() accepts **kwargs. How did I find it, you may ask? I set a breakpoint using pd

Re: calendar.js can't find variable gettext

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 8:56 PM, Todd Blanchard wrote: > I'm trying to use the date/time entry widgets from admin and I get this > javascript error and the controls don't render. > > Where is this supposed to come from? > > In annoyance, I have copied the head section precisely from an admin page

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Tim Valenta
Yeah, production servers aren't really very friendly to changes. Languages like PHP are specifically built to circumvent such woes. You would have to actually bounce apache in order to get the changes to take. This is why the development server is so nice, because when you alter certain files that

Re: Django with GXmlHttp

2009-11-24 Thread 504Django
Hmm ... the lack of a suggested solution to my question is discouraging. The lack of common knowledge in the developer community leads me to think that, aside from using the GeoDjango module, Django may not be able to elegantly integrate with Google Maps AJAX API. It that's truly the case, perhaps

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Crispin Wellington
Have a read of the mod_wsgi documentation, particularly the page: http://code.google.com/p/modwsgi/wiki/ApplicationIssues Because Django uses environment variables to access the settings file, all kinds of strife can occur when running Django on top of mod_wsgi. Essentially Django and mod_wsgi don

Re: reversing URLs

2009-11-24 Thread Tim Valenta
Thanks for the reply. Yes, I can give a bit more info on it. So, for starters, my (abbreviated) main url conf looks like this: urlpatterns = patterns('', (r'^surveys/', include('servicetrac.surveys.urls')), ) ... which links over to the app's urls: urlpatterns = patterns('s

Re: reversing URLs

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 4:49 PM, Tim Valenta wrote: > Ever since day one, I've never had a firm grasp on what the heck URL > reversing can do. I understand the concepts involved, even the admin > namespacing that can occur with different admin sites, and I know that > the admin uses it regularly,

Best way to use django for sql with raw LIKE statement

2009-11-24 Thread valhalla
Hi, I'm basically looking for the best way to implement something that produces SQL similar to: select col1, col2 from table1 where col1 like '%this%is%some%search %string?with?wildcards' I have worked around this with using the extra() method of the query but this can get real messy real fast.

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Tom
Sorry, I should have mentioned that this has only come up after deploying the project to a production server using mod_wsgi. It works absolutely fine under development. Tom On Nov 25, 2:24 am, Tim Valenta wrote: > Are you using the development server?  There's definitely caching > funny-busines

Re: Configure multi-field multi-select form in Django Admin

2009-11-24 Thread Tim Valenta
> The javascript will be found somewhere under django/contrib/admin/media/js. To be clear, rc, although the javascript is of course available for viewing, you should only need to put that attribute "filter_horizontal" on your ModelAdmin. There shouldn't be any need for inserting any custom javasc

Re: calendar.js can't find variable gettext

2009-11-24 Thread Tim Valenta
I'm a little unclear on part of that... does this not work only on certain pages? If it doesn't work at all anywhere, I'm not sure where you got the HTML for a working page. Are you sure that all of those URLs resolve to the right JS files? If you go to the page which messes up, and view the sou

Re: settings.py seems to be cached or stuck

2009-11-24 Thread Tim Valenta
Are you using the development server? There's definitely caching funny-business in a production web server, but that should affect you if you're using "manage.py runserver" Does stopping and starting the development server change anything? Tim On Nov 24, 6:54 pm, Tom wrote: > Hi all, > > I am

Re: Accessing model instance on pre_save signal

2009-11-24 Thread Tim Valenta
I think the answer is just in the documentation on the method: http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save No worries though. Signals are such a strangely uncovered topic in the main tutorials, and aren't easy to find documentation for unless you know what

Re: creating a drop down filter in Admin site

2009-11-24 Thread Tim Valenta
Not to my knowledge. Condensing them into drop-downs could be an option, though. That might make an interesting patch. I'm not familiar with that part of the code, but it would honestly be more of a template tweak than much code. I'm busy with several projects for the time being, but it would b

calendar.js can't find variable gettext

2009-11-24 Thread Todd Blanchard
I'm trying to use the date/time entry widgets from admin and I get this javascript error and the controls don't render. Where is this supposed to come from? In annoyance, I have copied the head section precisely from an admin page that work. Still doesn't work in my page.

settings.py seems to be cached or stuck

2009-11-24 Thread Tom
Hi all, I am experiencing TemplateDoesNotExist errors. Initially I thought I had my TEMPLATE_DIRS variable set incorrectly, but much experimentation yielded nothing. I then noticed that on the browser TemplateDoesNotExist error pages the TEMPLATE_DIRS setting reads as an empty tuple (). I then

Accessing model instance on pre_save signal

2009-11-24 Thread neridaj
Hello, I'm trying to change the upload_to attribute of an ImageField so that it is in the format "web_projects/year/slug/". The problem I am having is that the ForeignKey model is getting saved before the related ScreenShot model is able to call it's save method to change upload_to. I'm trying to

Re: Configure multi-field multi-select form in Django Admin

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 12:32 PM, rc wrote: > As I mentioned, the Django admin has exactly what I want with the user > permission form (auth_user, auth_permissions and > auth_user_user_permission). Does anyone know where that code is > located in the Django environment? > > That's done with javas

Re: german umlaute on search querys

2009-11-24 Thread Karen Tracey
On Tue, Nov 24, 2009 at 5:57 AM, Hinnack wrote: > Hi, > > I have django 1.1 and a mysql database created in utf-8. > My tables are also utf8 as the collation is, too. > > Showing data in a view works pretty well with german umlaute, but doing > a search with filter and icontains always returns an

creating a drop down filter in Admin site

2009-11-24 Thread Jase
Hoping someone could help me out. I am updating an admin site and added a couple "list_filter"s. They are rather long so I wanted to turn them into a drop down filter. Can this be done? Any suggestions? Thanks, Jase -- You received this message because you are subscribed to the Google Groups "Dj

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
Oops damn 'send' button on the iPod. The media attribute is a python property which aggregates all widget media. So everything is simplified to just using myform.media. Widgets are specified on form fields, if you want to change it from the default widget. Sent from my iPod; pardon any typos and

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
The 'media' attribute on forms are actually python proterties Sent from my iPod; pardon any typos and poor grammar! On Nov 24, 2009, at 5:02 PM, Todd Blanchard wrote: > Thanks, I feel like I'm making progress. > > Widgets define media too. I'm really fuzzy about how widgets get > loaded and ho

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
Thanks, I feel like I'm making progress. Widgets define media too. I'm really fuzzy about how widgets get loaded and how their media declarations get collected into the media object list. (I'm using contrib.gis which has nifty map widgets and it "just works" in the admin but now I'm building

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
Sorry-- I got out of sync with the replies. > Or am I missing something.  Seems like I am getting very much NON-DRY here. How many pages do you have dozens of forms on? If ever, I find that I've got a single form on the page. If you're writing an app complex enough to need such amazingly compli

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
No no no, I really really appreciate the help. But I'm definitely beginning to feel like my app is 80% boilerplate. On Nov 24, 2009, at 3:35 PM, Tim Valenta wrote: > PS -- I hope I don't sound like I'm insulting your intelligence--- I'm > not. I've often felt like there aren't enough policies i

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
PS -- I hope I don't sound like I'm insulting your intelligence--- I'm not. I've often felt like there aren't enough policies in Django, myself. But pick your battles. This is an easy one. I prefer Django over Rails, when it comes down to it. Feel fortunate that Django has practically the best

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
What is annoying is I have to repeat this incantation in every view function ever, yes?. If its got a form, I have to do this every time. I thought the idea was to write less code? Not the same code over and over again in every view. Or am I missing something. Seems like I am getting very mu

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
Sorry it's not working out for you, but I'd disagree about the comparison to X-Windows :) I'd be defending Django, and not X- windows, when I say that. I'm serious. Just add them together. I'm not sure you're appreciating the slick objects that have been crafted for this very purpose. Your vie

Re: Per-object permissions

2009-11-24 Thread Russell Keith-Magee
On Tue, Nov 24, 2009 at 11:16 PM, rebus_ wrote: > 2009/11/24 nek4life : >> You should look into django-authority.  I'm pretty sure that has per- >> object-permissions. >> >> http://packages.python.org/django-authority/index.html >> >> On Nov 24, 7:00 am, gamliel roi wrote: >>> Hello all, >>> >>>

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
You know what, this is absolutely too much BS. Why would one bother to use the media declaration stuff at all if there is no mechanism to properly consume it (a built in template tag for instance). I think I will just hardcode them in the head in the base template. They seldom change and brow

Re: How to unregister model?

2009-11-24 Thread Tomasz Zieliński
That patch is a hack that requires modifying live instance of Django, moreover I don't know what is influenced by it as I'm not that familiar with inner workings of model layer, so using it would be troublesome for me. So it seems that I have to write custom delete()s, using raw SQL.. -- Tomasz Z

Re: Module ho.pis can not be found when running on apache

2009-11-24 Thread Tim Valenta
I was caught by surprise when I moved my stuff to a production server, too. The live pythonpath is clearly different than you're expecting, which I'm sure you know already. My ultimate problem was that I was taking advantage of the fact that Django's development server puts your project on the py

Re: How to unregister model?

2009-11-24 Thread Tim Valenta
> http://code.djangoproject.com/ticket/10829 Seeing as how it was last updated over a month ago, you might be best off by downloading his patch and applying it, because there may not be a solution very quickly. Development for version 1.2 is going on right now, and they're focusing on brand-new f

Re: Designing base template - how to include media properly?

2009-11-24 Thread Tim Valenta
The idea is along the lines of what you initially guessed. The admin accomplishes the non-duplicate effect in django/django/ contrib/admin/options.py, starting at line 770. It loops over the forms and combines the existing media with the media on each form object. It ends up using a series of ob

Re: How to unregister model?

2009-11-24 Thread Tomasz Zieliński
On 24 Lis, 22:42, Tim Valenta wrote: > > I want my unmanaged models to literally disappear from Django sight, > > and then re-appear on demand. > > That sounds rather hack-ish... I'm not sure Django can do that > exactly.  I'm not familiar with the situation, exactly, so I'm unsure > of what you m

Re: virtualenv, PIP, fabric and patches to external projects

2009-11-24 Thread Kevin Teague
With patching Python code, there is always the option of dynamically modifying the code at run-time ... aka doing it monkey style. You can do this in a bit more orderly fashion by using something like the 'monkey' package, which lets you use a signature on the function being packaged, so that you b

reversing URLs

2009-11-24 Thread Tim Valenta
Ever since day one, I've never had a firm grasp on what the heck URL reversing can do. I understand the concepts involved, even the admin namespacing that can occur with different admin sites, and I know that the admin uses it regularly, but it seems like a crazy unpredictable wildcard when I try

Re: How to unregister model?

2009-11-24 Thread Tim Valenta
> I want my unmanaged models to literally disappear from Django sight, > and then re-appear on demand. That sounds rather hack-ish... I'm not sure Django can do that exactly. I'm not familiar with the situation, exactly, so I'm unsure of what you might be able to do differently. Apologies. Tim

Re: newbie questions regarding models and admin

2009-11-24 Thread Tim Valenta
Your first question about how to separate fields is not perfectly clear to me. However, I can say that I typically put *all* fields on the actual admin objects, since an admin is typically not the one you're trying to restrict. Then, in your own custom views (and the forms you render in those vie

Re: How to unregister model?

2009-11-24 Thread Tomasz Zieliński
On 24 Lis, 22:18, Tim Valenta wrote: > Sorry for double-post. > > Additionally, you might experiment with the Meta class attribute, > "abstract = True" on your wrapper models.   Thank you, I know about 'abstract' and I am using but unfortunately it doesn't help me much. What I need is the ability

Re: Django-1.1.1 builtin Development WebServer crashes with a core dump

2009-11-24 Thread Tim Valenta
It's not very clear what is happening. If you start a brand new project, there won't be any URLs for you to visit yet. It will most probably give you the error page, telling you that there is no URL matching the query. A better copy-and-paste would be what the browser is displaying. I hope I've

Re: How to unregister model?

2009-11-24 Thread Tim Valenta
Sorry for double-post. Additionally, you might experiment with the Meta class attribute, "abstract = True" on your wrapper models. It makes Django ignore the model when it does database table creation. That way, your wrapper acts more like a true Python inheritance object, where you simply get t

Re: How to unregister model?

2009-11-24 Thread Tomasz Zieliński
On 24 Lis, 22:15, Tim Valenta wrote: > If you're not doing anything fancy with AdminSite objects (ie, you're > only using the default admin site), then do this: > > # assuming you've already done: from django.contrib import admin > admin.site.unregister(MyModel) > The 'unregister' word seems to h

Re: How to unregister model?

2009-11-24 Thread Tim Valenta
If you're not doing anything fancy with AdminSite objects (ie, you're only using the default admin site), then do this: # assuming you've already done: from django.contrib import admin admin.site.unregister(MyModel) Note that it's exactly the opposite of the normal "admin.site.register ()" method

Copying files from remote server

2009-11-24 Thread bax...@gretschpages.com
I'm trying to import content from another server via RSS. My problem is with the images. Parsing the RSS with feedparser, I can get the image, but from there I've run into trouble. I can save a pointer to the remote file, but then I can't thumbnail or otherwise work with the image like a local fil

How to unregister model?

2009-11-24 Thread Tomasz Zieliński
Is there a way to unregister model from being seen by Django model manager? I have some unmanaged models that are wrappers around read-only database views and also have foreign keys to 'real' models. Now, when I'm trying to delete instance of 'real' model that is referenced by unmanaged model, I'm

virtualenv, PIP, fabric and patches to external projects

2009-11-24 Thread Alex Rades
Hi, I know this is probably not 100% django related (well, actually is 0%) but I think most of you have worked with virtualenv and PIP and this looks like a good place to talk about deployment scenarios. Basically, I'd like to handle dependencies of my virtual environment with PIP, but I have some

Re: Alternative model without Database

2009-11-24 Thread bruno desthuilliers
On 24 nov, 10:28, Elyrwen wrote: > Hello, > > I' ve been recently interested in Djagno framework and I am at the > point of choosing it as the framework for my project. My application > will not use database, but will use webservices to get data and then > process it. > > I need a substitute for t

Re: Module ho.pis can not be found when running on apache

2009-11-24 Thread brad
On Nov 24, 1:43 pm, "philip.bar...@impaerospace.com" wrote: > When I try running my project via Apache I get a "No module named > ho.pisa" error message. > > However, when I run the same project from django's built-in dev > server, it works just fine. > Well, this sounds very similar to a probl

Module ho.pis can not be found when running on apache

2009-11-24 Thread philip.bar...@impaerospace.com
When I try running my project via Apache I get a "No module named ho.pisa" error message. However, when I run the same project from django's built-in dev server, it works just fine. Similarly, when I access python, or go through python manage.py shell, I can import ho.pisa without error. I've tr

Re: Designing base template - how to include media properly?

2009-11-24 Thread Todd Blanchard
What about de-duping? If two forms want the same js file, will it get included twice? It seems like this is the kind of thing that the framework should handle and the current "solution" is kind of half baked. -Todd On Nov 23, 2009, at 2:40 PM, Mark (Nosrednakram) wrote: > > Hello, > > I have

Django-1.1.1 builtin Development WebServer crashes with a core dump

2009-11-24 Thread lbockhold
Hello users, I am new to django, just installed Django-1.1.1.tar.gz but: Machine HPUX: th...@dex: /home/th18bl > uname -a HP-UX dex B.11.11 U 9000/785 4042425557 unlimited-user license python: th...@dex: /home/th18bl > python ActivePython 2.6.2.2 (ActiveState Software Inc.) based on Python 2.6.2

Re: newbie questions regarding models and admin

2009-11-24 Thread Andreas Kuntzagk
Hi nek4life wrote: > The philosophy of the admin app is that it is a simple CRUD interface > for trusted staff members to manage data. If you need data entry for > non staff members (i.e. people you do not trust with the admin) you > should create public facing forms and setup some permissions fo

Re: even and odd numbers within a template

2009-11-24 Thread Kevin Renskers
{% for o in some_list %} ... {% endfor %} On Nov 24, 2:39 pm, Juan Hernandez wrote: > Hey there people... > > I've been coloring html tables using javascript for a while and now, we need > to color our tables just with html. The CSS has been made to use one color > for even row

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
The post before this one never made it. Strange. I have no other custom authenticate() methods. I did try to call my own directly, and this worked, but it's not the recommended way. Is there some more debug info I can turn on, to see what authenticate () methods Djongo is trying to invoke? It's app

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
After further examination, it looks like Django is completely ignoring my setting: AUTHENTICATION_BACKENDS = ('pg.ip.profile.auth_backend.AuthBackend','django.contrib.auth.backends.ModelBackend') Argh... Gloria -- You received this message because you are subscribed to the Google Groups "Djan

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
On Tue, Nov 24, 2009 at 5:28 PM, Gloria wrote: > Traceback: > File "/usr/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/ > core/handlers/base.py" in get_response > 92. response = callback(request, *callback_args, > **callback_kwargs) > File "/mnt/XP_D/Opencrowd/PressG

Re: Configure multi-field multi-select form in Django Admin

2009-11-24 Thread rc
As I mentioned, the Django admin has exactly what I want with the user permission form (auth_user, auth_permissions and auth_user_user_permission). Does anyone know where that code is located in the Django environment? On Nov 24, 10:13 am, rc wrote: > What I want to do is have a form with one fie

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
Environment: Request Method: POST Request URL: http://localhost:8000/login/ Django Version: 1.1.1 Python Version: 2.6.0 Installed Applications: ['attachments', 'avatar', 'soaplib', 'notification', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contr

Re: Alternative model without Database

2009-11-24 Thread Preston Holmes
On Nov 24, 1:28 am, Elyrwen wrote: > Hello, > > I' ve been recently interested in Djagno framework and I am at the > point of choosing it as the framework for my project. My application > will not use database, but will use webservices to get data and then > process it. > > I need a substitute f

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
What does the traceback look like? Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegro

Re: Alternative model without Database

2009-11-24 Thread Christophe Pettus
On Nov 24, 2009, at 1:28 AM, Elyrwen wrote: > My application > will not use database, but will use webservices to get data and then > process it. It can be challenging to excise all of the uses of the database from a Django application. Since you'll be caching the results of your web servic

Configure multi-field multi-select form in Django Admin

2009-11-24 Thread rc
What I want to do is have a form with one field that allows you to select a profile. Once this profile is selected there will be two windows below that show available tests and selected tests. The Django admin interface for the user permissions uses this format. Not sure what it is called in Django

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
Aye, there's the rub. My authenticate takes at least one parameter: from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.backends import ModelBackend class AuthBackend(ModelBackend): """ Custom authentication: No password, because o

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
On Tue, Nov 24, 2009 at 4:40 PM, Gloria wrote: > Hi all, > > I am using the SettingsBackend sample code, from here: > > > http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.authenticate > > in Django 1.1.1, python 2.6, and I get this error: > > TypeError at /login/ > authentica

custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Gloria
Hi all, I am using the SettingsBackend sample code, from here: http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.authenticate in Django 1.1.1, python 2.6, and I get this error: TypeError at /login/ authenticate() takes exactly 0 arguments (2 given) I've tried making Setting

how to test a signal that recived request and user objects?

2009-11-24 Thread Viktor
hi, I would like to write a signal handler that logs the user in when its account gets activated. My signal handler is registered with user_activated from django- registration, and my initial guess was this: def log_user_in(sender, **kwargs): login(kwargs['request'], kwargs['user']) user_act

Re: Per-object permissions

2009-11-24 Thread David De La Harpe Golden
gamliel roi wrote: > Hello all, > > I have the admin site up and running but I need to create a group of users, > such that each of the users will be able to edit objects that are only > relevant to them (e.g Project objects that the user is also the > ProjectManager). > > I know that in the past

Re: Per-object permissions

2009-11-24 Thread rebus_
2009/11/24 nek4life : > You should look into django-authority.  I'm pretty sure that has per- > object-permissions. > > http://packages.python.org/django-authority/index.html > > On Nov 24, 7:00 am, gamliel roi wrote: >> Hello all, >> >> I have the admin site up and running but I need to create a

Re: newbie questions regarding models and admin

2009-11-24 Thread nek4life
The philosophy of the admin app is that it is a simple CRUD interface for trusted staff members to manage data. If you need data entry for non staff members (i.e. people you do not trust with the admin) you should create public facing forms and setup some permissions for the users to be able to us

Re: Per-object permissions

2009-11-24 Thread nek4life
You should look into django-authority. I'm pretty sure that has per- object-permissions. http://packages.python.org/django-authority/index.html On Nov 24, 7:00 am, gamliel roi wrote: > Hello all, > > I have the admin site up and running but I need to create a group of users, > such that each of

Re: even and odd numbers within a template

2009-11-24 Thread Colin Copeland
Juan, The "cycle" template tag may help you here: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle colin On Nov 24, 2009, at 8:39 AM, Juan Hernandez wrote: > Hey there people... > > I've been coloring html tables using javascript for a while and now, we need > to color ou

Creating dynamic models?

2009-11-24 Thread Kevin Renskers
Hi all, In my Django project I want to have a model that is dynamically created. I tried using the __init__ function for this, something like so: fields = ['field_a', 'field_b', 'field_c'] class MyModel(models.Model): def __init__(self, *args, **kwargs): for field in fields:

even and odd numbers within a template

2009-11-24 Thread Juan Hernandez
Hey there people... I've been coloring html tables using javascript for a while and now, we need to color our tables just with html. The CSS has been made to use one color for even rows and another one for odds. How can I know if a current template loop is odd or even? I've been trying many differ

Re: Per-object permissions

2009-11-24 Thread Jani Tiainen
Most promising solution I've seen is django-authority. I haven't (yet) used it but I'm planning to do that at some point. Quick peek revealed that branch you mentioned is a quite outdated, last update is "only" two and half years old.. On Tue, 2009

Per-object permissions

2009-11-24 Thread gamliel roi
Hello all, I have the admin site up and running but I need to create a group of users, such that each of the users will be able to edit objects that are only relevant to them (e.g Project objects that the user is also the ProjectManager). I know that in the past Django had a Per-object permission

Weird en_gb locale problem

2009-11-24 Thread tawny
I have two servers which look identical. However, one runs the Django test page with en_gb the other doesn't. What is even more strange is everything was running as expected a few months back. I upgraded Django to 1.1.1 and using en_gb no longer works. I tried going back to the previous Django v

Re: How to resolve the view name from a url

2009-11-24 Thread greatlemer
> > No, I don't. > > > I want to know the name of the url for a given url pattern. So, when I > > get in my method the url someone is asking for (next='/people/'), I > > want to know the name of the url that identifies this pattern > > (people_name). It's not for a HttpRedirect, it's for statistica

Re: How to resolve the view name from a url

2009-11-24 Thread rebus_
2009/11/24 bcurtu : > No, I don't. > > I want to know the name of the url for a given url pattern. So, when I > get in my method the url someone is asking for (next='/people/'), I > want to know the name of the url that identifies this pattern > (people_name). It's not for a HttpRedirect, it's for

Re: Problem with unmanaged models and unit testing

2009-11-24 Thread Tomasz Zieliński
Thank you for you responses, I think I spotted the problem. My unmanaged model is in fact wrapper for database view. It also inherits from Django abstract model that has ManyToManyField-s onboard. When trying to test my app, syncdb.py in line 93 tries to actually add foreign key pointing from m2m

Re: Application auth and storing user in request.

2009-11-24 Thread Piotr Czachur
On 24 Lis, 10:05, Piotr Czachur wrote: > Hi! > > Why in auth middleware, user is assigned to request.__class__.user, > but in auth context processor it's read from request.user ? Isn't it > inconsistent? I've found answer here: answer http://stackoverflow.com/questions/766733/some-internals-of-

newbie questions regarding models and admin

2009-11-24 Thread Andreas Kuntzagk
Hi, I'm quite new to django and very new to this list. I'm in the process of writing a small webapp for our lab. Working with the tutorial I already put together a small model and some admin pages. But now I came to some stumbling blocks: First is a broader question: I'm wondering what belongs t

german umlaute on search querys

2009-11-24 Thread Hinnack
Hi, I have django 1.1 and a mysql database created in utf-8. My tables are also utf8 as the collation is, too. Showing data in a view works pretty well with german umlaute, but doing a search with filter and icontains always returns an empty queryset... if I convert the search back to iso-8859 I

Re: Avoiding MIME_BASE64_TEXT SpamAssassin Test when sending Email From Django?

2009-11-24 Thread rmschne
Jerek, Thanks ... starting now. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For m

Re: How to resolve the view name from a url

2009-11-24 Thread bcurtu
No, I don't. I want to know the name of the url for a given url pattern. So, when I get in my method the url someone is asking for (next='/people/'), I want to know the name of the url that identifies this pattern (people_name). It's not for a HttpRedirect, it's for statistical porpouses. It's so

  1   2   >