Re: Formsets issue

2009-02-18 Thread Brian Rosner
urceRoleForm.__init__ after this slight modification. Then you can simply check for None and deal with the fields attributes that way. Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Is safe unsafe?

2009-02-23 Thread Brian Neal
On Feb 23, 4:59 pm, Jacob Kaplan-Moss wrote: > On Mon, Feb 23, 2009 at 3:50 PM, Andy Mckay wrote: > > You want to use a script to only allow certain HTML tags and enforce a > > whitelist. Don't be naive and just use string or regular expression to > > strip only a few, there's lots of hacks that

Re: Is safe unsafe?

2009-02-24 Thread Brian Neal
On Feb 23, 10:51 pm, Jacob Kaplan-Moss wrote: > On Mon, Feb 23, 2009 at 7:49 PM, Brian Neal wrote: > > Interesting, I've also come across this: > > >http://codespeak.net/lxml/lxmlhtml.html#cleaning-up-html > > > I've heard it is very fast as it is just

Re: Media Root & Templates

2009-03-01 Thread Brian Morton
>From the traceback, it would appear that one or more of your processors is named or formed improperly. Can you post the code from your setting.py file where you specify your processors? Not just the strings, but the entire Python structure where you define those. On Mar 1, 7:51 am, AKK wrote:

Cannot create model objects with file fields from shell

2009-03-03 Thread Brian Morton
I am having trouble getting this script to work. My intent is to load images into the db in bulk from the filesystem. http://pastebin.com/m40565da9 When I execute this, I get the following error: Traceback (most recent call last): File "load_images.py", line 16, in GalleryImage.objects.

ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
I'd like to make my own custom view. In the past I did this by following the django book and added a URL to my main urlpatterns above the '^admin/(.*)' pattern. But I noticed a new get_urls function on the ModelAdmin class in the docs. I'm on trunk, and just did an svn update to 9975 to try this o

Re: ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
On Mar 4, 9:11 pm, Brian Neal wrote: > I'd like to make my own custom view. In the past I did this by > following the django book and added a URL to my main urlpatterns above > the '^admin/(.*)' pattern. But I noticed a new get_urls function on > the ModelAdmin clas

Re: ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
On Mar 4, 10:06 pm, Brian Neal wrote: > On Mar 4, 9:11 pm, Brian Neal wrote: > > > > > I'd like to make my own custom view. In the past I did this by > > following the django book and added a URL to my main urlpatterns above > > the '^admin/(.*)' p

Re: ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-05 Thread Brian Neal
On Mar 4, 10:06 pm, Brian Neal wrote: > On Mar 4, 9:11 pm, Brian Neal wrote: > > > I'd like to make my own custom view. In the past I did this by > > following the django book and added a URL to my main urlpatterns above > > the '^admin/(.*)' pattern. B

Django and Python Warnings

2009-03-06 Thread Brian Neal
I updated my working copy of Django after a long period and was browsing the source and noticed it was taking advantage of the Python warnings module. What is the best way to "see" such warnings when doing development? Is it possible to configure Python or the Django development server to display

Re: Django and google app engine

2009-03-12 Thread Brian Jinwright
; code. > > Thanks in Advance > Guri > > > -- Brian Jinwright Co-Owner Qwigo Web Solutions http://www.brianjinwright.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django user

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Brian Neal
On Mar 16, 2:14 pm, NoviceSortOf wrote: > > So perhaps a better question would be is > > in view.py... > --- > thisusername = str(request.user.username) > data = {'thisusername':username,} > form = form_class(data) > > Why is it form_class(data) does not accept the data > as declared and

Re: Value proposition of Rails

2009-03-19 Thread Brian Morton
Given how expensive developer time is relative to current hardware costs (especially on the x86 server platforms), it is almost always more cost effective to throw hardware at the problem than it is to spend countless hours porting apps from one language or framework to another for performance rea

I'm having some trouble with GenericForeignKey

2009-03-20 Thread Brian McKeever
What am I doing wrong? Is there any other way to do what I want? I'm basically trying to implement the GOF's strategy design pattern (the real code is more complicated than this example). ## my models class Donkey(models.Model): name = models.CharField(max_length=11) class Barn( models.M

Re: I'm having some trouble with GenericForeignKey

2009-03-20 Thread Brian McKeever
Thank you. I appreciate the quick response. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send

Re: django ORM not compatible with postgres

2009-03-22 Thread Brian Neal
On Mar 22, 8:15 am, Joshua Partogi wrote: > Dear all, > > I just encounter this error using pyscopg2 as my db adapter > Exception Type:         ProgrammingError > Exception Value:        can't adapt > Exception Location: >         /usr/lib/python2.5/site-packages/django/db/backends/util.py in > e

Re: Additional Javascript include in ModelAdmin

2009-03-22 Thread Brian Neal
On Mar 22, 11:15 am, Roy wrote: > That would require the extra files be hosted on my media url though. I > want to be able to link js externally so I can use stuff like YUI, > etc. without having to host it. No, not if you use a fully qualified string like "http://some-url-to- my-media". --~--~-

Re: django ORM not compatible with postgres

2009-03-22 Thread Brian Neal
On Mar 22, 2:56 pm, Mike Ramirez wrote: > On Sunday 22 March 2009 09:25:42 am Brian Neal wrote: > > > > But from what you posted, I'm guessing that line needs to read: > > > obj.user = User.objects.get(username=request.user) > > I think wha

Re: need a multiselect list box for a static list of options

2009-03-23 Thread Brian Neal
On Mar 23, 1:49 pm, Adam Fraser wrote: > Hello, > > This should be a pretty simple question.  I have a list of options: > > STAIN_CHOICES = ( >     (1, 'DNA - DAPI'), >     (2, 'DNA - Hoechst'), >     (3, 'DNA - other'), >     (4, 'Actin - Phalloidin'), >     (5, 'Tubulin'), > ) > > I would like

Re: need a multiselect list box for a static list of options

2009-03-23 Thread Brian Neal
On Mar 23, 3:36 pm, Adam Fraser wrote: > I found the SelectMultiple widget here: > > http://docs.djangoproject.com/en/dev/ref/forms/widgets/ > > But I still don't know how to hook that up to a model like > CommaSeparatedIntegerField. > > help? > Did you try something like this? This is off the t

Re: need a multiselect list box for a static list of options

2009-03-24 Thread Brian Neal
On Mar 24, 8:55 am, Adam Fraser wrote: > Still doesn't work.  Maybe I should be more specific. > > I'm editing projectprofiler/projects/models.py which hasn't needed to > import forms for anything, and when I do I get very strange errors. > > Here's what it looks like now: > > from django.db impo

Re: Apache 2.2 >> Forbidden You don't have a permission to access /static_media on this server

2009-06-23 Thread Brian Neal
On Jun 23, 5:29 am, MarcoCanali wrote: > I have this error message from apache 2.2 server when i try to access > at mine static_media for my django project. Apache serve my project in > django without static file such as css or image ... Check your file permissions. Can the apache process read t

Re: Question IMAGE in Django

2009-06-23 Thread Brian Neal
Also check the permissions on your images. I had set the FILE_UPLOAD_PERMISSIONS to 0640 in development, but this wasn't correct for my production server. Ensure that Apache or whatever user the webserver is running has read access to your images. --~--~-~--~~~---~--~--

Re: Encryption question

2009-06-23 Thread Brian Neal
On Jun 23, 8:39 am, daniel wrote: > Good morning, > > I have a MySQL (version 5.0.5 running on Ubuntu 8.04) database > containing encrypted fields (the encryption was done using mysql's > AES_ENCRYPT). The database is normally accessed by an application > written in C++ and Qt. However, I also ne

Re: Using formfield_overrides to add TinyMCE

2009-06-25 Thread Brian Neal
On Jun 25, 2:33 pm, Pes wrote: > Hi All, > > I feel like there’s something simple I’m overlooking here. I can't > seem to get TinyMCE to work when I use the built-in widget from Django- > TinyMCE. This works if I uncomment the Media class at the bottom, but > the widget version of TinyMCE simply

Re: Rendered output from a template tag

2009-06-26 Thread Brian May
silly to have to duplicate everything for every tag. However the documentation seems to suggest it is not possible to simplify this? -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: how to call a view from inside a decorator?

2009-06-27 Thread Brian May
ldn't that be "return f(*args,**kwargs)"? ie. don't you need to return the value? -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: context objects get cached/stored across requests, somehow

2009-07-06 Thread Brian Neal
On Jul 6, 10:08 am, Haes wrote: > Hi, > > I've created a view which displays a simple list of all objects of one > model. If a 'search_string' URL parameter is defined, the list is > filtered by this search string and the search string itself will be > displayed in the template as well. > Please

Report Failures when running Django's unit tests?

2009-07-10 Thread Eric Brian
Ok, so I finally got Django's unit tests to run and when I did, there was one failure. I checked the FAQ to see if this should be reported or not. There was no mention, so I wonder, should I report any test that doesn't pass? --~--~-~--~~~---~--~~ You received this

Re: Does post_save signal need to be in models.py?

2009-07-11 Thread Brian Neal
On Jul 11, 12:54 pm, Ryan K wrote: > I am trying to avoid circular dependency issues  between signals.py > and models.py. Is there any reason why I can't connect the post_save > signal in signals.py itself (the function is connects with would be in > the same file? Should I import it in the apps/

Re: Model save() weird behaviour

2009-07-20 Thread Brian May
do that? The only line containing QWERTY is commented out, and even if it wasn't commented out it does nothing. Maybe you meant to say: self.fulltitle = self.title = 'QWERTY' As such, what you have is: self.fulltitle = self.title self.title

Re: permalink don't works

2009-07-29 Thread Brian May
mpt to pass kwargs instead of args (which doesn't work - seems so obvious now...). I think django is great, unfortunately sometimes the documentation is lacking. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Removing objects with many-to-many relationship

2009-07-30 Thread Brian May
-to-many relationships are a different story. You do have to be careful here. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Stopping people loging in twice

2009-07-31 Thread Brian May
y have died, and now they are trying to log in on another computer. They can't log out on the first computer - it crashed. Instead they will have to wait for the session to time out. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are

Re: permalink don't works

2009-07-31 Thread Brian May
sequence for the second parameter in > this case, because we only want to pass keyword parameters, not > positional ones. > --- > isn't it the right text? Yes, you are right. Not sure how I missed this now. Repeatedly. :-( -- Brian May --~--~-~--~~---

Re: Select_related and foreign keys

2009-08-05 Thread Brian May
uldn't it help here too? {% for i in object.object_set.select_related %} ... {% endfor %} Or have I misunderstood how select_related works? -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: Timezones in Django

2009-08-10 Thread Brian May
. So I have two fields, one for the datetime in UTC, and another one for the timezone. I have a template filter (or tag - my memory is fuzzy) to convert the UTC time to the specified timezone for displaying. -- Brian May --~--~-~--~~~---~--~~ You received this m

Poor performance on POSTs in production

2009-08-15 Thread Brian Morton
Very strange problem going on with one of my Django sites. This only happens in my production env using Debian stable, Apache 2.2.9 with mod_python and django trunk (updated). All GET requests execute in a timely manner. However, all POSTs take way too long. I've inserted debugging into my vie

Re: how to deploy an app that gets used by people in multiple time zones

2009-09-04 Thread Brian Neal
On Sep 4, 10:47 am, Margie wrote: > > Can someone clarify what format dates and times are stored in when > using just a standard DateTimeField?  Is my timezone encoded in the > database or is some generic, non-timezone-specific date/time stored? There is no timezone encoded. The dates/times are

Re: DST or not

2009-09-05 Thread Brian Neal
On Sep 5, 4:03 pm, zweb wrote: > Is there any way to know if for a timezone , on a praticular date > time, is DST active or not? > it is required by localize command of pytz. How to find it > programatically? > > >>> est_dt = eastern.localize(loc_dt, is_dst=True) > >>> edt_dt = eastern.localize(l

Re: Editors of choice

2009-09-08 Thread Brian McKeever
I recently learned vim, and I'm a ginormous fan of it for editing. Although, I use pydev for difficult debugging. On Sep 8, 5:37 am, Mike Ramirez wrote: > On Tuesday 08 September 2009 04:11:38 ThinRhino wrote: > > > Mike, > > > Does Eric4 support mercurial? I tried google, but did not find an

Re: Editors of choice

2009-09-08 Thread Brian Jones
d me first, and I can only store so many arbitrary, inane keystroke shortcuts in my brain ;-P brian On Tue, Sep 8, 2009 at 1:10 PM, Jeff Gentry wrote: > > On Mon, Sep 7, 2009 at 2:55 PM, Samuel Hopkins >wrote: > > Anyhow, the purpose of this email was just to ask the communit

Re: Proper way of importing projects modules

2009-09-10 Thread Brian Jones
for, and find, myproj1, but it'll point at your renamed directory. Hope this helps. Like I say, it's better form to just do the right thing up front and do the renaming, but this can help in the interim. brian 2009/9/10 Filip Gruszczyński > > > Your choice. I prefer the firs

Re: need a multiselect list box for a static list of options

2009-03-26 Thread Brian Neal
On Mar 26, 9:59 am, Adam Fraser wrote: > hrm, I think I'm _finally_ starting to understand how django is meant > to be used. > > Question: Why can't I just specify the widget used by a particular > field from my model in the admin interface. > > stains = models.CommaSeparatedIntegerField(widget=S

Re: Including username in FileField upload_to path

2009-03-26 Thread Brian Neal
On Mar 26, 3:56 pm, Rajesh D wrote: > On Mar 26, 3:21 pm, IanSR wrote: > > > I've spent the last few hours trying variations on upload_to for my > > FileField path generator get_file_path(instance,filename) that will > > allow me to include the username from the POST HttpRequest object.  No > >

Re: Django wont display images on my CSS file

2009-03-27 Thread Brian Neal
On Mar 27, 7:33 am, Gath wrote: > Guys, > > Am having a problem in displaying images in my CSS file. > > I have a css file with the following class > > .header > { >  margin-left: auto; >  bla bla >  bla bla >  ... > background: url(/site_media/header_background.gif) no-repeat top left; > > } > >

Re: django.contrib.auth.models.User User model can't be saved

2009-03-28 Thread Brian Neal
On Mar 28, 7:02 am, Joshua Partogi wrote: > Yes you're right. In my template I only have username, first_name, > last_name, email and password. I also print out the errors too. Probably what is happening is that some of the other fields you are excluding are required fields. Thus you should use

Re: Date Filtering in Django-Sphinx

2009-03-30 Thread Brian Neal
On Mar 30, 6:11 am, Alfonso wrote: > > And in my search view I have a simple filter (which is where I think > the problem lies): > > if date == "next30": >        results = queryset.filter(date_time>=(datetime.datetime.now)) > > (Attempting to pull future dates just to see something happen) > > W

Re: Time lookup

2009-03-30 Thread Brian Neal
On Mar 30, 10:12 am, LD wrote: > Hi, > > I don't have idea how to do simple task. > I have model with DateTimeField and I want to retrieve all objects > that have time for example lower than 2pm. > > I know about Django queryset lookup like year, month, day. Is there > something similar but for t

Re: Time lookup

2009-03-31 Thread Brian Neal
On Mar 31, 5:31 am, LD wrote: > OK, but Django do not provide 'time' lookup so my problem is 'how to > retrieve time part of datetime field in a query' Ok, then why are you storing date and time together when all you care about is time? To me, when you have a DateTimeField, that represents a poi

Re: widget=forms.HiddenInput doesn't work

2009-04-01 Thread Brian Neal
On Apr 1, 8:16 pm, rizzoo wrote: > How do I make a field hidden when using ModelForm?  I tried > HiddenInput but it appears to be ignored. > > code:http://dpaste.com/22290/ > Line 9 > > Here's what View Source shows for that line in the browners: > Last: name="last" maxlength="45" > Well it look

Re: widget=forms.HiddenInput doesn't work

2009-04-01 Thread Brian Neal
On Apr 1, 10:19 pm, "Michael Rose Jr." wrote: > > Brian. Thanks for responding. I mean to post "name". I've been > experimenting with other field types, which why I accidentally pasted > "last". Here is the HTML for "name". > Na

Re: widget=forms.HiddenInput doesn't work

2009-04-01 Thread Brian Neal
On Apr 1, 10:19 pm, "Michael Rose Jr." wrote: > > Brian. Thanks for responding. I mean to post "name". I've been > experimenting with other field types, which why I accidentally pasted > "last". Here is the HTML for "name". > Na

Re: How to widen the text fields in the admin pages for editing records

2009-04-07 Thread Brian Neal
On Apr 7, 3:04 pm, Mac wrote: > Any pointers to the documentation for getting the text fields larger > for CharField data?  They're kinda puny for columns that are defined > to have up to 255 characters.  Thanks! You do it by supplying your own widget to the form field. See: http://docs.djangop

Re: Help! PNG file upload error...

2009-04-10 Thread Brian Neal
On Apr 9, 12:45 am, higer wrote: > When I upload a PNG file and use PIL to handle it,there will be an > error occured: > 'NoneType' object is unsubscriptable > > I do not know why and other formats(BMP GIF JPG JPEG) are all ok. I don't know if this is your problem, but in order to use certain fi

Re: Customizing admin form

2009-04-10 Thread Brian Neal
On Apr 10, 4:46 pm, Oleg Oltar wrote: > Hi! > > I have a model which contains several TextFields and CharFields. I want to > make all char fields longer and wider. How to do it? > > Thanks, > Oleg You can supply your own form that is using customized widgets to construct the fields with. http:/

Re: Mulitple Time Zone support?

2009-04-12 Thread Brian Neal
On Apr 12, 7:15 pm, ydjango wrote: > What is the best way to provide multiple Time zone support? Definitely check out the Python pytz module. > (Also where can I get list of all time zones to populate the  select > dropdown.) > There is almost 400 time zones in the "common timezones" in pytz.

Re: Use Python to parse HTML and integrating said script into Django

2009-04-13 Thread Brian Neal
On Apr 13, 9:44 am, Tonne wrote: > It's the calendar with the unusual form/structure  that I'm > struggling to implement with the stock Django tools. > > I'll take a step back and give it another shot with logic in view and > parsing in the template. I'm not sure what you mean by "parsing"...I a

Re: Trouble with DateField

2009-04-13 Thread Brian Neal
On Apr 13, 11:47 am, Brandon Taylor wrote: > Hi everyone, > > I need a sanity check here. I'm using a jQueryUI DatePicker, with the > dateFormat option set to 'yy-mm-dd', which is returning a date in - > MM-DD format, if I check my request.POST values. > > I have a DateField - "effective_from

Re: Converting from local DST to UTC

2009-04-14 Thread Brian Neal
On Apr 14, 7:26 pm, Jamie wrote: > I am working on an app that will export a calendar event to Google > Calendar. Google Calendar requires that event datetimes be in UTC > format. I can make the conversion from local (America/New_York) to UTC > using pytz, but the time is off by an hour due to da

Re: newbie: syncdb doesnt update schema after model change?

2009-04-16 Thread Brian Neal
On Apr 16, 11:00 am, gry wrote: > [django: 1.1 beta 1 SVN-10407, python 2.5.2, ubuntu] > My first django toy app.  I've been working through the > tutorialhttp://docs.djangoproject.com/en/dev/intro/tutorial02/. > I've already done a few cycles of  (change-model, ./manage.py syncdb) > with succes

Re: TemplateSyntaxError: Settings issue?

2009-04-16 Thread Brian Neal
On Apr 16, 11:33 am, Aneesh K wrote: > > Why is the TemplateSyntaxError raised, and why don't I see this > problem on my development server? > > Thanks! > Aneesh Could be a python path problem? Put the directory that has your application in it on the python path. I think when you do the manage.p

Re: Problem with in long text fields in templates

2009-04-20 Thread Brian Neal
On Apr 20, 11:31 am, NoviceSortOf wrote: [...] > When attempt to using {{ book.description }} in the template, it > outputs all the tags onto the screen, > when what we want is actual line breaks. > [...] > > Can someone please give me a clue as to how to make this work or where > to find inform

How to include session data in traceback

2009-04-30 Thread Brian Morton
I am considering filing an enhancement request but I want to check first to make sure this functionality doesn't already exist. Is there some way to make Django include the contents of session in the traceback email received from a 500 error? It is very useful in the case of debugging an error w

Re: How to include session data in traceback

2009-04-30 Thread Brian Morton
n the pickle module accept a string as input and output the unpickled data? I know it does it with file objects via load, but I can't find any reference on how to do this with a string. On Apr 30, 12:43 pm, Malcolm Tredinnick wrote: > On Thu, 2009-04-30 at 04:58 -0700, Brian Morton wr

Re: How to include session data in traceback

2009-04-30 Thread Brian Morton
D'oh. Thanks. I was confusing load and loads. I thought they were the same thing. On Apr 30, 12:55 pm, Malcolm Tredinnick wrote: > On Thu, 2009-04-30 at 09:47 -0700, Brian Morton wrote: > > Thanks.  That makes perfect sense.  Since my session data is persisted > > in the

I'm having some trouble with signals.

2009-04-30 Thread Brian McKeever
I'm sure I made some dumb mistake, but I just can't see it. Basically, I'm having difficulty connecting to the signal with my model. #my test def test_set_trigger_bug(self): self.assertEqual(len(game_reset.receivers), 0) def trigger(): pass

Re: Flatpages only works when settings.DEBUG = True

2009-05-04 Thread Brian Neal
On May 4, 10:28 am, Ronghui Yu wrote: > Hi,All, > > I am going to use Flatpages app for those simple pages. And everything > works fine when settings.DEBUG is True, but when it is turned to False, > a URL not configured in urlpatterns will trigger 500, not 404. Do you have a 404.html error templ

Re: A puzzling problem with admin

2009-05-13 Thread Brian Neal
On May 13, 10:13 am, andybak wrote: > Getting somewhere... > > I'm running on Django 1.0 via nginx/fcgi > > When I run via the dev server (leaving everything else the same) the > problem goes away. > > How can the effects of a POST to a model form in admin be affected > purely by switching betwee

Re: Callable objects instead of functions in views.py

2009-05-20 Thread Brian Neal
On May 20, 8:33 am, Filip Gruszczyński wrote: > I was wondering: have you considered using some callable objects to > serve requests in views.py instead of functions? Sure, check out this blog post (not the only example): http://www.screeley.com/entries/2009/apr/01/class-based-views-and-reusabl

[br...@vpac.org: selecting foreign keys]

2009-05-20 Thread Brian May
ody please provide a link to the discussion? Thanks. - Forwarded message from Brian May - Date: Fri, 13 Mar 2009 12:26:12 +1100 From: Brian May Subject: selecting foreign keys To: undisclosed-recipients: ; Newsgroups: gmane.comp.python.django.user Hello, A frequent problem people seem to

reverse URLs on Debian Lenny

2009-05-21 Thread Brian May
lresolvers import reverse >>> reverse('person_list') '/photos/person/' So it would appear that on Debian Lenny, reverse URLs are broken when using include(...) Are there any known compatibility issues with Django and Debian Lenny? If not, how do I debug this issu

Re: reverse URLs on Debian Lenny

2009-05-21 Thread Brian May
On Fri, May 22, 2009 at 10:06:50AM +1000, Brian May wrote: > urlpatterns = patterns('', > [...] > (r'^(.*)', include('microcomaustralia.zoph.urls')) > [...] > ) Errr... Sorry, found out it was my fault. That should be: (r'^', include(&#x

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-24 Thread Brian Neal
On May 24, 6:50 pm, Continuation wrote: > For example, I have a view edit_profile that edits a user's profile. > Obviously I want to make sure that each user can edit his own profile > only. > > So before the profile of user A is being edited by edit_profile, I > want to make sure the current use

prev/next links

2009-05-25 Thread Brian May
. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-user

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-25 Thread Brian Neal
On May 25, 3:41 am, Andy wrote: > > But how do I stop user A from trying to edit the profile of user B? You don't let them. You control which profile you get from and save to the database, right? You look at the request.user object and only manipulate the data associated with the user specified

Re: prev/next links

2009-05-26 Thread Brian May
r that would mean the URL refers to the object via search result number, as opposed to object id. Something I hoped to avoid. However, maybe I might have to take this approach anyway. Considering the object ids are not guaranteed to be in sequential order, it might be the only solution. -

Re: [br...@vpac.org: selecting foreign keys]

2009-05-26 Thread Brian May
On Thu, May 21, 2009 at 10:45:06AM +1000, Brian May wrote: > A frequent problem people seem to have with Django[1] is the default > interface for selecting foreign keys is slow and clumsy to use if there > are lots of selections. To the best of my knowledge there is no solution > i

comma seperated lists

2009-05-28 Thread Brian May
erent data types, and rather not have to create a custom tag for every one. If I can help it. Thanks. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: comma seperated lists

2009-05-28 Thread Brian May
ike just what I was after... I never thought of using forloop.last in an if condition like that. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: comma seperated lists

2009-05-31 Thread Brian May
't click on the items in the list. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe

Re: comma seperated lists

2009-05-31 Thread Brian May
On Fri, May 29, 2009 at 01:50:38AM -0700, V wrote: > if you do this to get a comma separated list you might like > https://launchpad.net/django-export-csv No, I don't use CSV here, but it is nice to know such a facility exists - I have used CSV for other projects. Thanks. --

Re: dumpdata and loaddata as simple DB migration tool?

2009-06-03 Thread Brian May
mp that data with column names. So if the change meant the columns were in a different order (or new columns between old columns), the import would be wrong. As a result I migrated to mysql, which is more flexible. -- Brian May --~--~-~--~~~---~--~~ You received

Re: multiple column primary key

2009-06-03 Thread Brian May
in the index, meaning it can't be used. -- Brian May --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsu

Re: dumpdata and loaddata as simple DB migration tool?

2009-06-03 Thread Brian May
ase changed after doing a loaddata/dumpdata. I could reproduce this on demand. I don't expect anybody to take my claims too seriously, the problems I encountered were probably fixed ages ago. I don't like to assume something is fixed though unless I ha

Re: reverse url fails on existing url

2009-06-16 Thread Brian May
> arguments '()' and keyword arguments '{'args': u'my_name'}' not found. I haven't double checked, but I think that should read: {% url public_comments user.username %} or {% url public_comments username=user.username %} -- Brian May --~--~---

Re: Memcached, out of sockets

2009-06-16 Thread Brian Neal
On Jun 15, 7:28 pm, Miles wrote: > I've been running the python memcached connector for a while, without > much trouble. But just today during a stress test of one of the feeds > (read: many many requests expected), I've ran into an out of sockets > situation. > > After every single request, the

Re: Django for Google API - Google Search, Google Map

2009-06-18 Thread Brian Neal
On Jun 18, 5:42 pm, Olavgo wrote: > I want to write a website that I think will be using the Google API > (search and map). > > Is there any special reason the do it with Python?  Django? Well, I'm not real sure about the search API, but the Maps API is all Javascript. BN --~--~-~--~---

Re: Django and CSS

2009-06-18 Thread Brian Neal
On Jun 18, 2:50 pm, Chris DPS wrote: > Hi, > > I'm new to Django. > I've read the > doc:http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs > which is about static files but still do not quite understand what to > call everything and it isn't working > On my development machine

How do you keep a django project encapsulated?

2009-09-17 Thread Brian McKeever
Particularly, how do you write the project in such a way that database queries don't constantly have to reach across 5 classes? For example, this query needs to know the innards of the Definition, UserDefinition, and UserData classes: basic_query = Definition.objects.filter(concept = conc

Re: django forum

2009-09-20 Thread Brian Neal
On Sep 20, 11:10 am, dijxtra wrote: > Is there a free robust django forum app? Or more precisely, a free and > robust forum app which uses django.contrib.auth for authentication? > > Or should I just try out those several projects enabling django to > access phpBB's user info and use phpBB3? The

Re: nested block definitions

2009-09-21 Thread Brian Neal
On Sep 21, 10:37 am, Daniel Roseman wrote: > > Anything in a child template that is outside of a > {% block %} is ignored. > I usually have a few {% load %} tags in child templates above {% block %} to bring in needed template tags. BN --~--~-~--~~~---~--~~ You r

Re: Could Django handle this particular setup?

2009-09-23 Thread Brian McKeever
Here's the documentation for the sites framework which does everything you need: http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites On Sep 23, 3:13 pm, Jean-Nicolas wrote: > I would like to use Django for my next project, however, the setup is > a bit particular and I'm no

Re: Sqlite3

2009-09-23 Thread Brian McKeever
What does your DATABASE_NAME setting set to in your settings.py file? I know django gives that error if the path is set incorrectly. It needs to say something like: '/home/user_name/django_project/ your_database.db' if you're using sqlite On Sep 23, 4:47 pm, RcCypher wrote: > First I'd like to s

Re: django-trackback usage?

2009-09-23 Thread Brian McKeever
I would put all signal code in the models. I'm afraid I'm not familiar with trackback, but I would imagine that all you'd need to do is: from django.db.models.signals import post_save def your_trackback_function(sender, **kwargs): #whatever goes here post_save.connect(your_trackback_functio

Re: How to update a ManyToManyField in a model's custom save method

2009-09-23 Thread Brian McKeever
Try using a postsave signal. It'll automatically trigger your method upon saving a Project. http://docs.djangoproject.com/en/dev/topics/signals/#receiver-functions Basically, all you'd need is: from django.db.models.signals import post_save def member_check(sender, **kwargs): #your code po

Re: Django + QT4

2009-09-23 Thread Brian McKeever
I imagine you're talking about using django models for database management? There's nothing stopping you really. Django is just a python program. All you need to do is: Create a django project (as per the tutorial). Set up the database like normal in your settings file. Create your app with man

Re: What JavaScript framework do you use and why?

2009-09-23 Thread Brian McKeever
I just decided to learn to use dojo yesterday. I chose it because it has a huge library of GUI widgets that are all suppose to be accessible to people with disabilities. I found this: http://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks quite helpful. What I didn't know until recentl

Re: Finding unique ForeignKey enties.

2009-09-23 Thread Brian McKeever
To only get one image, you use a limit. like movie.images_set.all()[:1] On Sep 22, 2:37 pm, Joshua Russo wrote: > On Tue, Sep 22, 2009 at 7:23 PM, MV wrote: > > > I have a Movie model > > and I have a Image model > > the Image model has a ForeignKey(Movie) > > > Each Movie has an arbitrary amo

Re: Design question

2009-09-23 Thread Brian McKeever
I remember a quote from either headfirst java or design patterns that said something like: "The key to inheritance is to abstract functionality." I realize we're not talking about inheritance, but I think it still applies. It may make logical sense that a user object has a blog that has entries,

<    1   2   3   4   5   6   7   8   9   10   >