Re: Problem with memcache - very bad performance

2010-02-22 Thread Szymon
Hello, I've turned -vv logging and sometimes it throws: >18 ERROR <18 ccopy_reg >18 ERROR <18 _reconstructor >18 ERROR <18 p1 >18 ERROR <18 (cdjango.db.models.query >18 ERROR <18 QuerySet >18 ERROR <18 p2 >18 ERROR <18 c__builtin__ >18 ERROR <18 object [snip - it's long] Some problem with

Re: Is the user member of a certain group

2010-02-22 Thread Joakim Hove
Thank you both; it works! Joakim On Feb 23, 12:27 am, Andy McKay wrote: > On 2010-02-22, at 2:56 PM, Joakim Hove wrote: > > > Any tip on how to write the "user_is_member_of_admin_group()" > > function? > > You can access the groups via the ManyRelatedManager, which exposes a

Re: ContentType/GenericRelations question

2010-02-22 Thread Scott SA
Ouch, I hate the high-speed, palm-forehead interface... esp. in public! LOL Not sure why this didn't occur to me earlier, but I found a solution to what I am looking for (I'm still curious to know if there is an easier way, always like to go with the flow when possible). In short, the related

Re: ValidationError: ManagementForm data is missing or has been tampered with

2010-02-22 Thread DrMeers
I have the same problem -- only intermittently, only IE, can't put my finger on what is causing it. A couple of times a month I get an emailed error message coming through. I have not been able to replicate it on my machine, even using IE and performing the same operation; very odd. -- You

Re: how to get as_sql() to work again

2010-02-22 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 10:42 AM, felix wrote: > > On Feb 23, 12:32 am, Russell Keith-Magee > wrote: > >> To reinforce my point - if you're using Django's ORM, you shouldn't >> have to care about the underlying query. The ORM *should* be >>

Re: weird CSS behaviour

2010-02-22 Thread Josh Kersey
It would be nice to see your templates. Post the django template code for base, index, and register somewhere like dpaste.com and then provide us the link. Kind of hard to make a guess at this point but seeing the code will help. - Josh cabedge.com On Feb 22, 8:55 am, Maciek Strzelecki

Re: how to get as_sql() to work again

2010-02-22 Thread felix
On Feb 23, 12:32 am, Russell Keith-Magee wrote: > To reinforce my point - if you're using Django's ORM, you shouldn't > have to care about the underlying query. The ORM *should* be > abstracting these details so that you don't care. I realize that > inspecting query

ContentType/GenericRelations question

2010-02-22 Thread Scott SA
Hopefully this won't be a forehead slapper of a question. Since related classes do not have an 'object' manager, what is the best way to get all of those objects as a set? For example, if I have a BaseClass that has a generically-related AttributeClass, I can get the attributes from an instance

Re: Best practices for restricting media?

2010-02-22 Thread Graham Dumpleton
On Feb 23, 5:00 am, David De La Harpe Golden wrote: > On 22/02/10 16:48, Brice Leroy wrote: > > > Hello Brett, > > If you use nginx you can use the X-Accel-Redirect function. > > Minor: if you _don't_ use nginx but rather apache or lighttpd, > similar feature is

Re: Problem with PIL in Mac OS X 10.4

2010-02-22 Thread piz...@gmail.com
Thank you very much, I followed your instructions and it worked perfectly. This is what I've done (if someone needs it): - Download jpeg6b - Copy the config.sub and config.guess located at ~/gtk/source/ libtool-2.2.6/libltdl/ (I've installed GTK+ for OSX with gtk-osx- build-setup.sh so I

Re: django and ldap

2010-02-22 Thread Peter Herndon
On Feb 22, 2010, at 3:13 PM, andreas schmid wrote: > Peter Herndon wrote: >> On Mon, Feb 22, 2010 at 9:40 AM, andreas schmid wrote: >> >> >>> im experiencing strange problems now. the user is able to authenticate >>> against ldap only if in the active directory the

Re: how to get as_sql() to work again

2010-02-22 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 1:17 AM, felix wrote: > > On Feb 22, 9:22 am, Russell Keith-Magee > wrote: >> > However getting the SQL that will be produced is essential.  There >> > needs to be a utility method somewhere that will give us this sql and >>

Re: Is the user member of a certain group

2010-02-22 Thread Andy McKay
On 2010-02-22, at 2:56 PM, Joakim Hove wrote: > Any tip on how to write the "user_is_member_of_admin_group()" > function? You can access the groups via the ManyRelatedManager, which exposes a queryset: user.groups.filter(...) eg: if user.groups.filter(name="Admin") -- Andy McKay, @clearwind

Re: Is the user member of a certain group

2010-02-22 Thread Tim Shaffer
There may be a more efficient way, but you can use this for starters: if ( "admin" in request.user.groups.values_list("name",flat=True) ): On Feb 22, 5:56 pm, Joakim Hove wrote: > Hello, > > using the django auth framework I have created two groups called > "admin" and

Re: Problem with PIL in Mac OS X 10.4

2010-02-22 Thread Tim Shaffer
You'll have to manually install libjepg to get PIL working on a Mac. If you have MacPorts installed, you should just be able to do "sudo port install jpeg". Otherwise, you can download it from one of these locations: http://dir.filewatcher.com/d/GNU/Other/jpegsrc.v6b.tar.gz.613261.html Then

Is the user member of a certain group

2010-02-22 Thread Joakim Hove
Hello, using the django auth framework I have created two groups called "admin" and "normal" and all the users are members of either of these groups. Now when a user is authenticated I would like to render different views depending on which group the user is member of, something like this: if

Problem with PIL in Mac OS X 10.4

2010-02-22 Thread Oscar Carballal
Hello, I've just installed Django CMS in my Mac OS X 10.4.11 with Python 2.6. One of the requisites is the PIL library, which I've installed through "easy_install" and tested after installation. Even when the Python interpreter loads the module and works fine with it, Django and Django CMS keep

Problem with restructuredtext filter

2010-02-22 Thread Gianluca Pacchiella
I have written for a personal django app (actually a blog), a new restructured text role that allows to use TeX syntax and rendering math formulas; the problem is that I don't want to allow this in comment. To avoid to load the TeX related role I use the following snippet of code where I delete

Re: Problem with memcache - very bad performance

2010-02-22 Thread Szymon
On 22 Lut, 22:50, Javier Guerra wrote: > are you sure you get memcached store on RAM? maybe it's being swapped out Yes. Swap hasn't been touched yet since last reboot. Mem: 400M Active, 2915M Inact, 354M Wired, 66M Cache, 214M Buf, 193M Free Swap: 4000M Total, 4000M Free

Re: Problem with memcache - very bad performance

2010-02-22 Thread Javier Guerra
On Mon, Feb 22, 2010 at 4:34 PM, Szymon wrote: > On 22 Lut, 21:15, Szymon wrote: >> 5 secs. > > CPU secs. of course. > > Now, on lighter traffic (same view). > > 12.1%   0.069 build/bdist.freebsd-7.1-RELEASE-amd64/egg/memcache.py > > Strange. Probably on higher load

Re: Admin screen pluralizing models inappropriately and database relations question

2010-02-22 Thread Timothy Kinney
I'm still struggling with obtaining a nice list of items for a samurai in the admin view. I can iterate over them in a template, but I want to get them all at once in an admin view without iteration. I have a separate model for Inventory which has foreign keys for Samurai and Item. The trick is to

Re: Problem with memcache - very bad performance

2010-02-22 Thread Szymon
On 22 Lut, 21:15, Szymon wrote: > 5 secs. CPU secs. of course. Now, on lighter traffic (same view). 12.1% 0.069 build/bdist.freebsd-7.1-RELEASE-amd64/egg/memcache.py Strange. Probably on higher load I will get faster response times just querying DB. :S Any suggestions? Maybe

Re: Problem with DateField (Rooky)

2010-02-22 Thread Shawn Milochik
DEFAULT_DATE_INPUT_FORMATS is on the deprecation timeline, just FYI. The formatting options are for the way data can be input into a form object. Django always stores dates the same way (per database backend). Are you using Django with an already-existing database full of data? Also, your code

Problem when copy django-admin templates directory

2010-02-22 Thread konatufe
I'm trying to change django templates to my own directory templates copying the django-admin templates directory. cp -R /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ templates/admin /home/konatufe/djproyect/djapp/templates/ When do that, I can't see the change_list page of admin

Re: Slugify() and Clean form data Questions

2010-02-22 Thread Jon Loeliger
> > Hope this better answers your question, > Matt Matt, Indeed it does. Thank you! I guess a bit of the frustrating part of learning Django here is stumbling across the sites that explain how to do various tidbits of functionality, and then slide in some variant [*1*] of "But one would never

Problem with DateField (Rooky)

2010-02-22 Thread anvasila
My DataBase has the dates like "2003-08-31" and the django take them like this: "May 9, 2024".How can i change that in Django? At first i was trying something like this date=models.DateField(default="%Y-%m- %d) Next is try this: from django import forms from django.forms.fields import

Problem with memcache - very bad performance

2010-02-22 Thread Szymon
Hi, I'm using latest Django trunk and have problems with memcache. For few days my site is struggling with performance. I've blamed mod_wsgi, I've blamed Apache, I've blamed Postgres on dedicated box, I've blamed everything but today I've done profiling... and the winner is... 72.1% 4.862

Re: django and ldap

2010-02-22 Thread andreas schmid
Peter Herndon wrote: > On Mon, Feb 22, 2010 at 9:40 AM, andreas schmid wrote: > > >> im experiencing strange problems now. the user is able to authenticate >> against ldap only if in the active directory the displayName == username >> why this? i dont get any error or

Re: Slugify() and Clean form data Questions

2010-02-22 Thread Matt McCants
Django's database API does a lot of the worrying for you. It will autoescape the more dangerous aspects of user input when executing SQL. You'd have to be more careful if you were executing raw queries and even then you'd have to be running those queries as literal strings instead of parameterized

Re: Slugify() and Clean form data Questions

2010-02-22 Thread Peter Herndon
On Mon, Feb 22, 2010 at 12:32 PM, Jon Loeliger wrote: > I get is_valid() and the notion of cleaned data.  I *think*, > though, that I am asking for something more robust. > > Will some_form.is_valid() will, say, remove (or identify) > embedded SQL hacking attempts from a plain text

Re: django and ldap

2010-02-22 Thread Peter Herndon
On Mon, Feb 22, 2010 at 9:40 AM, andreas schmid wrote: > im experiencing strange problems now. the user is able to authenticate > against ldap only if in the active directory the displayName == username > why this? i dont get any error or traceback, the user only isnt able

Re: Problem

2010-02-22 Thread rennat
need more info, like a code example and the data that is causing the validation error On Feb 22, 6:20 am, "saurabhpres...@gmail.com" wrote: > Enter a valid date/time in -MM-DD HH:MM[:ss[.uu]] format. > Request Method: POST > Request URL:    

Re: pushing messages on a webapp

2010-02-22 Thread rennat
You might look at using Comet, I haven't personally used it yet but there were some cool things done with it at PyCon this year. I don't know if this is the best how to but it came up pretty high in google search: http://anirudhsanjeev.org/tutorialhow-to-django-comet-orbited-stomp-morbidq-jsio/

Re: POST from external site

2010-02-22 Thread Tim Shaffer
What does the HTML for the Django-generated form look like? What does the HTML for the non-Django-generated form look like? Are you using Django Cross Site Request Forgery protection? On Feb 22, 12:27 pm, kkerbel wrote: > Let me further clarify...when I post using django it

Django REST and FILEFIELD field

2010-02-22 Thread manu.polline
Hi everyone, my name is Manuel. I'm tryng to upload a file directly in a filefield of Django model exposed by django-rest-interface. It'is possible? this is my model : class File(models.Model): file = models.FileField(upload_to='files', help_text=_("file itself")) page =

Re: Djamgo cookies

2010-02-22 Thread adamjamesdrew
Yes understood but how do other websites work? Makes no sense. I'm going to try to create an account at a different django website to test On Feb 22, 12:44 pm, Timothy Kinney wrote: > If a user disallows cookies on their own machine, there's nothing you can do > about

Re: Generate random data for Django models

2010-02-22 Thread Timothy Kinney
Okay, I got it. There was a typo in the hard-coded url pattern. The following actually does not work: ** code ** (r'^/1/add_random_samurai/$', self.admin_site.admin_view( self.add_random_samurai)) ** /code ** But this does: ** code ** (r'^1/add_random_samurai/$',

Re: Best practices for restricting media?

2010-02-22 Thread David De La Harpe Golden
On 22/02/10 16:48, Brice Leroy wrote: Hello Brett, If you use nginx you can use the X-Accel-Redirect function. Minor: if you _don't_ use nginx but rather apache or lighttpd, similar feature is called "X-Sendfile". -- You received this message because you are subscribed to the Google Groups

Re: Djamgo cookies

2010-02-22 Thread Timothy Kinney
If a user disallows cookies on their own machine, there's nothing you can do about it. This is why a lot of websites say: "You need to have cookies enabled." On Mon, Feb 22, 2010 at 10:27 AM, adamjamesdrew wrote: > This is not an issue with me as I can just turn off the

Re: Slugify() and Clean form data Questions

2010-02-22 Thread Jon Loeliger
> > Is there a reason why you can't use Form.is_valid()? It's pretty nice. > > http://docs.djangoproject.com/en/dev/ref/forms/api/#accessing-clean-data > > Example: > http://gist.github.com/311192 I get is_valid() and the notion of cleaned data. I *think*, though, that I am asking for

Re: Problem with defer

2010-02-22 Thread Dexter
Oh, I'm sorry, no error appears, but the queryset returns the complete objects with all the fields, not only the name field On Mon, Feb 22, 2010 at 6:30 PM, Daniel Roseman wrote: > On Feb 22, 5:15 pm, Dexter wrote: > > Hi, > > > > Im using django

Re: Problem with defer

2010-02-22 Thread Daniel Roseman
On Feb 22, 5:15 pm, Dexter wrote: > Hi, > > Im using django 1.1.1, and i'm trying to defer a queryset, but it doesn't > seem to work. > Here's my callback: > > def open(request, id=None): > > >     """Callback to fire when a specific floor is opened.""" > >     if

Re: POST from external site

2010-02-22 Thread kkerbel
Let me further clarify...when I post using django it works as expected, meaning I have another view that which processes a new form I submit from django. I wrote a standalone html form on my desktop and tried submitting to the view and it still does not work. On Feb 22, 11:17 am, kkerbel

Re: apparent bug in QuerySet

2010-02-22 Thread Marco Rogers
This is interesting. I think the two examples you give are distinct use cases and they should be. But I think it's just as common to want to do what felix is doing. Essentially he wants to modify a queryset as it exists by adding or overriding additional parameters. It can be very convenient

POST from external site

2010-02-22 Thread kkerbel
I'm attempting to write a listener page which will take POST variables sent from an external payment site to verify whether payment was successful or not. Here is the view: def results(request): if request.method == 'POST': test = request.POST.get('pmt_status')

Re: how to get as_sql() to work again

2010-02-22 Thread felix
On Feb 22, 9:22 am, Russell Keith-Magee wrote: > > However getting the SQL that will be produced is essential.  There > > needs to be a utility method somewhere that will give us this sql and > > it needs to remain stable. > > Well, no -- it isn't essential. It might be

Problem with defer

2010-02-22 Thread Dexter
Hi, Im using django 1.1.1, and i'm trying to defer a queryset, but it doesn't seem to work. Here's my callback: def open(request, id=None): > """Callback to fire when a specific floor is opened.""" > if request.user.is_authenticated(): > if id: > data =

Re: Toggle TinyMCE in admin

2010-02-22 Thread When ideas fail
Would that just do one field rather than all the text areas? On 22 Feb, 16:41, orokusaki wrote: > I think you can do this by adding the exact HTML that you need into > the label field for a form (I can't remember if you have to explicitly > turn off HTML filtering

Re: Best practices for restricting media?

2010-02-22 Thread Brice Leroy
Actually, this snippet should be better to explain X-Accel-Redirect feature: http://www.djangosnippets.org/snippets/491/ 2010/2/22 Brice Leroy > Hello Brett, > If you use nginx you can use the X-Accel-Redirect function. Technicaly, you > get the file request on django,

Re: Best practices for restricting media?

2010-02-22 Thread Brice Leroy
Hello Brett, If you use nginx you can use the X-Accel-Redirect function. Technicaly, you get the file request on django, you check if the user should have an access to the file and then you send back a header with the filename inside to your instance of NGinx. Nginx then serve the file.

Re: SAAS User and Auth situation.

2010-02-22 Thread orokusaki
@Wes The only problem with using email addresses is that a person could have a User on multiple different accounts and this would not allow for that, unless there was some sort of one-login-to-rule-them- all situation, which there won't be. Imagine a hosted CMS called "Super CMS". A single web

Re: Ajax request, json object, fields with instance of inherits class converted in regular string

2010-02-22 Thread esatterwh...@wi.rr.com
you can also use simplejson and return data the way you want it. It isn't able to serialize date or time objects natively but this still covers 99% of the cases. from django.utils import simplejson from django.http import HttpResponse def view(request): return

Re: SAAS User and Auth situation.

2010-02-22 Thread orokusaki
@Daniel Thanks for muaccounts. I don't know if it'll work because it appears to be coupled to sub domains ( which I may or may not use ). I'll have to dig more into it later tonight. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Toggle TinyMCE in admin

2010-02-22 Thread orokusaki
I think you can do this by adding the exact HTML that you need into the label field for a form (I can't remember if you have to explicitly turn off HTML filtering though, check the docs to be sure). I would just put Toggle The id_tag_of_field is of course available dynamically. -- You received

Re: Toggle TinyMCE in admin

2010-02-22 Thread When ideas fail
Oh I should mention I have already added the javascript function to the page by including the JS file. So I really only need to include the link next to textareas. On 22 Feb, 16:34, When ideas fail wrote: > Hello, I've been using TinyMCE for a WYSIWYG editor on my

Toggle TinyMCE in admin

2010-02-22 Thread When ideas fail
Hello, I've been using TinyMCE for a WYSIWYG editor on my admin text areas. However I would like to be able to toggle it on and off like this: http://tinymce.moxiecode.com/examples/example_01.php But I wasn't sure of the best way to do this. Does anyone have any suggestions? Andrew -- You

Re: Djamgo cookies

2010-02-22 Thread adamjamesdrew
This is not an issue with me as I can just turn off the firewall. I'm concerned with other people who have this installed who won't be able to use my website. On Feb 21, 7:20 pm, adamjamesdrew wrote: > This is a default install for a computer associates firewall. Any >

Re: How to make the login forms available to the entire site?

2010-02-22 Thread rennat
I have used a context processor to keep track of a global login form and process logins before. This method and rebus_'s "submit all to a login URL" are both valid ways to do this. On Feb 22, 11:00 am, Josh Kersey wrote: > I've always done it as rebus_ explained.  Put the

Re: Overriding widget for forms.ModelMultipleChoiceField in ModelForm

2010-02-22 Thread rennat
Here is how I accomplished this with a ModelForm class VariationForm(forms.ModelForm): option_values = forms.ModelMultipleChoiceField(queryset=Value.objects.none(), widget=CheckboxSelectMultiple(), required=False) class Meta: model = Variation def __init__(self, *args,

Re: django and its interactive shell on osx

2010-02-22 Thread rennat
This seems to be an IPython problem. at quick glance it looks like your version of IPython is incomplete. Try reinstalling or check the changelogs, I don't keep up with ipython but its possible a new version had backwards incompatible changes that django needs to account for now. hope that helps

Re: Slugify() and Clean form data Questions

2010-02-22 Thread Matt McCants
Is there a reason why you can't use Form.is_valid()? It's pretty nice. http://docs.djangoproject.com/en/dev/ref/forms/api/#accessing-clean-data Example: http://gist.github.com/311192 On Sat, Feb 20, 2010 at 11:25 AM, Jon Loeliger wrote: > > Folks, > > A few days ago I asked: > >

Re: How to make the login forms available to the entire site?

2010-02-22 Thread Josh Kersey
I've always done it as rebus_ explained. Put the login options in the base template wrapping it in {% if user.is_authenticated %} to display a different mechanism for users that are already logged-in. That form action is set to the login URL and and the login view handles the login processing,

Re: formset media

2010-02-22 Thread anentropic
{{ formset.media }} will output the script tags *and* the css link tags On Feb 22, 11:53 am, anentropic wrote: > A formset should have a 'media' attribute which should include all the > media from the widgets in the forms which make up the formset, so in > the template you

Re: weird problem with django admin models and webfaction

2010-02-22 Thread Simon Davies
Duh!! yeah restarting apache did it. How did I forget something so simple!! Thanks Simon On 22 Feb, 15:04, Shawn Milochik wrote: > Did you manually restart the Apache instance for this app? > > I had a similar problem, and it turned out that I had a bit of code in one of

Re: Record is saved, but no join table entry is created - weird problem

2010-02-22 Thread Tom
Ah! Thanks Tom, that fixed it. Tom On Feb 22, 3:27 pm, Tom Evans wrote: > On Mon, Feb 22, 2010 at 3:11 PM, Tom wrote: > > Hi all, > > > I have a view that takes data from a form and saves it in the db.  One > > of the fields is a M2M linking to

Re: Record is saved, but no join table entry is created - weird problem

2010-02-22 Thread Tom Evans
On Mon, Feb 22, 2010 at 3:11 PM, Tom wrote: > Hi all, > > I have a view that takes data from a form and saves it in the db.  One > of the fields is a M2M linking to another model.  The record itself > saves fine, but no entry in the M2M join table is created.  I am > passing

Record is saved, but no join table entry is created - weird problem

2010-02-22 Thread Tom
Hi all, I have a view that takes data from a form and saves it in the db. One of the fields is a M2M linking to another model. The record itself saves fine, but no entry in the M2M join table is created. I am passing the form initial data for the M2M in the form of a list of id numbers

Re: weird problem with django admin models and webfaction

2010-02-22 Thread Shawn Milochik
Did you manually restart the Apache instance for this app? I had a similar problem, and it turned out that I had a bit of code in one of my model that was pulling from a table that was no longer defined. Check for that as well. -- You received this message because you are subscribed to the

weird problem with django admin models and webfaction

2010-02-22 Thread Simon Davies
Hi I'm still developing my app and I have just refactored my models in my django app. I dropped most of the existing tables on my local dev machine and then completely rebuilt everything using syncdb, everything worked fine, including the admin, no probs at all. Then I updated everything on my

weird CSS behaviour

2010-02-22 Thread Maciek Strzelecki
Hello, and straight to the point: Once upon a time there was a Base Template, called base.html: http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> some title [... and the body continues] Please note that i put links to css in HEAD part. Now, i click between two main pages of my

Re: pushing messages on a webapp

2010-02-22 Thread Dexter
Hi there, I was wondering if it is possible to push messages to client side, or is the only possible way polling from client to server. Grtz, Dexter -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: anybody tried web2py and gone back to Django?

2010-02-22 Thread Richard
I tried web2py and haven't gone back, though sometimes it is tempting when I see so much Django work available! On Feb 18, 7:48 am, snfctech wrote: > If so, could you provide a bullet list of things you preferred in > Django?  Thanks. -- You received this message

Problem

2010-02-22 Thread saurabhpres...@gmail.com
Enter a valid date/time in -MM-DD HH:MM[:ss[.uu]] format. Request Method: POST Request URL:http://127.0.0.1:8000/book/edit/ Exception Type: ValidationError Exception Value: Enter a valid date/time in -MM-DD HH:MM[:ss[.uu]] format. -- You received this message because you are

Re: SAAS User and Auth situation.

2010-02-22 Thread Wes Turner
On Feb 21, 11:09 pm, orokusaki wrote: > I'm developing an SAAS which means that I will have Accounts and those > Accounts will have Users. Each account's Users are completely > orthogonal to the Users of another Account. When a user logs in, > they'll supply an Account

Using generic date_based.object_detail view without specifying a day

2010-02-22 Thread Dan Carroll
Hi all, I am currently working on a blog for my website utilizing the date_based generic views for a lot of the presentation. The problem that I am running into, though, is that date_based.object_detail requires specifying the 'day' parameter:

Re: what is up with InternalError current transaction is aborted, commands ignored until end of transaction block

2010-02-22 Thread talpay...@gmail.com
i actually found a solution. i don't know what the problem is... and it wouldn't mater anyway. I just wanted to catch and show a message about it. You should you something like this: from django.db import transaction @transaction.commit_manually def view(request): try: #do something

Re: django and ldap

2010-02-22 Thread andreas schmid
Peter Herndon wrote: > On Feb 5, 2010, at 5:45 AM, andreas schmid wrote: > > >> ok django-ldap-groups works perfectly now! >> >> > > That's great to hear! If you run into any issues, I'll be happy to help > troubleshoot. > > ---Peter > im experiencing strange problems now. the user is

Re: Adding a new language to Django?

2010-02-22 Thread Daniel Roseman
On Feb 22, 2:16 pm, Derek wrote: > I'm sure I am using the wrong search terms, but I am trying to find out how > add a new language to "skin" the entire interface. > > The only reference I could find was: > Only languages listed in the >

Re: allowing other chars in User.username

2010-02-22 Thread Aljosa Mohorovic
On Feb 22, 1:58 pm, Dougal Matthews wrote: > I'm not sure what your reason if for using such characters? enabling non-english names to be used (with chars like čćžđš), separating first and last name with other chars (like "first.last_name" or "first-last_name" or "first

Adding a new language to Django?

2010-02-22 Thread Derek
I'm sure I am using the wrong search terms, but I am trying to find out how add a new language to "skin" the entire interface. The only reference I could find was: Only languages listed in the LANGUAGESsetting can be selected.

Re: NoReverseMatch is making me crazy

2010-02-22 Thread andreas schmid
Tom Evans wrote: > On Mon, Feb 22, 2010 at 11:01 AM, andreas schmid wrote: > >> im experiencing a problem since today: >> >> my model : >> >>class Technology(models.Model): >> title= models.CharField(max_length=250, >>help_text=_('Type in the

Re: what is up with InternalError current transaction is aborted, commands ignored until end of transaction block

2010-02-22 Thread Shawn Milochik
The problems is that some part of your code is screwing up something with your database connection. Then, some other part of your code tries to use the database and it can't, so it breaks. Find out where the error is coming from (from your traceback), then figure out what code executes before

Re: have trouble with safe and linebreaks together

2010-02-22 Thread Tom Coote
It wouldn't really matter if you needed to use something like html2pdf in the future because you can always run a context through a template to get the modified string including all the html before then using html2pdf. Also keeping that kind of display logic in templates means its easily modified

IP address and NetScaler application delivery device

2010-02-22 Thread jfine
I'm running a Django/Pinax website (www.mathtran.org) whose host wishes to move it to the NetScaler application delivery device. This will change the IP address from which the applications appear to come from (to the NetScaler device). The (real) client IP address is available in a HTTP header

Admin: 1364, "Field 'id' doesn't have a default value"

2010-02-22 Thread Jonathan Sutcliffe
Hi, I wonder if anyone can help me. I am trying to use the admin to create a new group and assign permisisions. When I try to save the object I see the fllowing error message. OperationalError at /admin/auth/group/add/ (1364, "Field 'id' doesn't have a default value") Request Method:

Custom button for imagefield form

2010-02-22 Thread CrabbyPete
I have form with where users can upload an image. All works well but I want a graphic instead of the default browse button that shows up. Can I change it and if so how do you change it in the form field or template? class ProfileForm(SignUpForm): mugshot = forms.ImageField

Re: allowing other chars in User.username

2010-02-22 Thread Dougal Matthews
On 22 February 2010 11:56, Aljosa Mohorovic wrote: > what are security concerns if username is allowed to contain chars > like ".,;-() " and non-ascii alphabet letters? > will orm still properly escape string before querying the database? > > Aljosa > > In short, yes

Re: have trouble with safe and linebreaks together

2010-02-22 Thread Ali Rıza Keleş
On Sun, 2010-02-21 at 15:27 -0800, Benjamin wrote: > If you still want to give your users quite a bit of formatting power > (other than just 'title' and 'body' fields), consider letting them use > something like markdown, restructured test, or something similar. This > way your application is safe

TextField in BaseCommentAbstractModel

2010-02-22 Thread kioopi
Hi, contrib.comments.models.BaseCommentAbstractModel's field object_pk is a TextField to allow for models without integer-ids to be commented. This manifests as a longtext field in the (mysql) DB. This leads to a lot of full-table-scans, which turn out to be a performance problem. So far i'm

Re: have trouble with safe and linebreaks together

2010-02-22 Thread Ali Rıza Keleş
On Sun, 2010-02-21 at 14:24 -0800, cootetom wrote: > You have a mix of techniques here. You are allowing markup to be saved > into the database and then when being displayed in a template you are > again adding mark up there to! Why don't you have a model which has a > "title" field and a "body"

Re: NoReverseMatch is making me crazy

2010-02-22 Thread Tom Evans
On Mon, Feb 22, 2010 at 11:01 AM, andreas schmid wrote: > im experiencing a problem since today: > > my model : > >    class Technology(models.Model): >         title        = models.CharField(max_length=250, >    help_text=_('Type in the technology title')) >         body  

allowing other chars in User.username

2010-02-22 Thread Aljosa Mohorovic
what are security concerns if username is allowed to contain chars like ".,;-() " and non-ascii alphabet letters? will orm still properly escape string before querying the database? Aljosa -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: formset media

2010-02-22 Thread anentropic
A formset should have a 'media' attribute which should include all the media from the widgets in the forms which make up the formset, so in the template you should be able to just {{ name_of_formset_var.media }} in the head of your page to output the necessary script tags. On Feb 17, 3:13 pm,

NoReverseMatch is making me crazy

2010-02-22 Thread andreas schmid
im experiencing a problem since today: my model : class Technology(models.Model): title= models.CharField(max_length=250, help_text=_('Type in the technology title')) body = models.TextField(help_text=_('Type in the description of the technology'))

Re: Othogonal aspects to models

2010-02-22 Thread klaasvanschel...@gmail.com
Thanks Shawn - but James' talk is exactly what got me into this mess :-) I'm aware of the possibility of specifying the model to be used as a default kw arg in views etc. But I want all my models to become 'owner aware'. http://code.google.com/p/django-granular-permissions/ approaches the model's

Re: SAAS User and Auth situation.

2010-02-22 Thread Daniel Hilton
On 22 February 2010 05:09, orokusaki wrote: > I'm developing an SAAS which means that I will have Accounts and those > Accounts will have Users. Each account's Users are completely > orthogonal to the Users of another Account. When a user logs in, > they'll supply an

what is up with InternalError current transaction is aborted, commands ignored until end of transaction block

2010-02-22 Thread talpay...@gmail.com
I have search far and wide for some help regarding the Internal Error and i can't find any help. I have absolutely no idea why this is showing it doesn't make any sens. I just want a way to catch it but that is impossible. I would appreciate any help. Traceback: File

Re: A Query question about Many-to-many relationships

2010-02-22 Thread Jason
Hi Atamert, Thank you so much! The following statement works! This is really simple but fantastic!!! Publication.objects.filter(article__in = article_qs).annotate(Count('article')) Sincerely, Jason -- You received this message because you are subscribed to the Google Groups "Django users"

Re: how to get as_sql() to work again

2010-02-22 Thread Russell Keith-Magee
On Mon, Feb 22, 2010 at 2:41 AM, felix wrote: > As of 1.2 and multi-db how do I get the sql that will be produced from > a query set ? > > Since 1.2 and multi-db, the previous methods are no longer working. > Its been said here that we shouldn't depend on internal

Re: apparent bug in QuerySet

2010-02-22 Thread Russell Keith-Magee
On Mon, Feb 22, 2010 at 4:48 AM, felix wrote: > > This seems so blatant that it couldn't really be a bug without someone > noticing. Django 1.2 > >        qs = Apt.objects.filter(list_on_web=True,is_available=True) > >         # FastAdderStatus has Apt and Service as fk >  

  1   2   >