Can't access the development server

2008-11-17 Thread Ben
#x27;m assuming that when I try to connect to port 8000 this will go directly to the development server and apache settings etc should be irrelevant? How about python settings? Is it possible that I've got something misconfigured that would cause this behaviour?

Re: Can't access the development server

2008-11-18 Thread Ben
Thanks -- that solved it! Ben On 17 Nov, 21:16, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 8:14 AM, Ben <[EMAIL PROTECTED]> wrote: > > > [snip] > > > I start the development server using: > > > python manage.py runs

Re: Do you recommend "Practical Django Projects"?

2009-01-05 Thread Ben
work). I found learned a lot more this way than if everything went smoothly by coping the examples. There is also a doc that specifically points out what are backwards incompatible changes http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges -Ben On Jan 5, 5:16 pm, "David

Inline with Grouper

2009-06-30 Thread Ben
quot;{{ adminform.first_field.auto_id }}").focus(); {% endif %} {# JavaScript for prepopulated fields #} {% prepopulated_fields_js %} {% endblock %} #TemplateSyntaxError is "'int&#x

Re: Tutorial 2 - Template Dirs

2009-06-30 Thread Ben
Hey this might be a question I can answer - I'm a NKOTB too. The easiest way is to modify the "title" and "branding" blocks in the base_site.html file. This would change the name for the admin across the site, as far as I know. It should live in (in your case) /home/ divesh/projects/myproject/t

syncdb doesn't updated database after adding null=True to an IntegerField

2009-07-15 Thread Ben
I'm using the admin site. I noticed that I couldn't leave an IntegerField empty even when I had "year = models.IntegerField (blank=True)". I googled and found out I should set null=True as well. I did this, ran syncdb, and it didn't fix the issue. I am using sqlite3 with a temporary database. I r

Quick Newbie Question - reverse ManyToMany in admin site

2009-08-12 Thread ben
it overkill for just showing the relationship in the admin site. Cheers Ben --~--~-~--~~~---~--~~ 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

default settings for applications

2009-06-05 Thread ben
I'm wondering if a convention exists for dealing with applications settings. I'm thinking of having the default settings to be specified in my application in a default_settings.py file but be overridden by any values in DJANGO_SETTINGS_MODULE. I can do this easily enough, but it feels like some

Re: default settings for applications

2009-06-06 Thread ben
using something like django.conf.settings but where the defaults are in the application itself rather than in django.conf.global_settings. It sounds like there's no convention for something like this. On Jun 5, 10:46 pm, Ben Davis wrote: > I'm not sure that there's a real "stan

Deleting objects in Admin - Circular References

2009-06-10 Thread ben
If I have two models that contain foreign keys to each other, e.g. class Quiz(models.Model): current_question = models.ForeignKey('Question') class Question(models.Model): quiz = models.ForeignKey('Quiz') , where there are multiple questions in each quiz, but only one is current. When

Puzzling filter/annotation of queryset based on count

2009-11-10 Thread ben
however I can't figure out the correct configuration of annotations and filters to get back what I want! I'm sure this will take a seasoned djangonaut a few seconds to figure out so any help is appreciated! Cheers Ben --~--~-~--~~~---~--~~ You received this mes

Generic Many-To-Many without GenericRelations

2010-02-11 Thread ben
Generic Many-To-Many Relationships I have a collection class which contains arbitrary objects using a Generic Many-To-Many relationship. class Collection(models.Model): name = models.CharField(max_length=VERBOSE_NAME_MAX_LENGTH) def member_objects(self, klass): """Returns a Quer

dynamic inlines (svn #12297) and older template logic breaking down

2010-03-04 Thread ben
ly #12297 2 gallery image add options - galleryimages-0-image and galleryimages- __prefix__-image Under current SVN is there a way to excude the __prefix__ instance within the template? If not, would it be worth submitting a feature request to enable the ability to discern between the two kinds of n

Re: dynamic inlines (svn #12297) and older template logic breaking down

2010-03-04 Thread ben
Update - it seems that excluding the prefix elements can be done by excluding forloop.last in addition to formsets that are data bound. the stacked.html template in contrib mirrors this. While it doesn't seem to be the futureproof solution I'd hoped for, it does work. Perhaps the best move would be

run single regression test from test suite

2010-03-14 Thread ben
these tests aren't in an app I'm not sure how to run them individually. Cheers, Ben -- 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

How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
one of the available choices." The same thing happens when I attempt to use SelectMultiple as the widget. Can anyone tell me what I am doing wrong? I have googled about but have not been able to find anything describing how to handle this. Thanks, Ben -- You received this message b

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
hing for this on djangosnippets.  Search hard. > > > > On Fri, Apr 2, 2010 at 1:09 PM, ben wrote: > > Hi, I am new to Django. I am currently using the latest Django 1.2 > > from trunk. I am trying to store a list of values in a > > CommaSeperatedIntegerList. I would li

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
Sorry. I pasted code that I was experimenting with. I thought maybe the validation code was looking for strings because that is what the error code said it was looking for. Before that I had been using integers and that doesn't seem to work either. I am wondering if this is a bug in Django 1.2. I h

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-03 Thread ben
ppens regardless of the number of choices, types of the choices tuple values, or the model field type. Can anyone point me to an example that demonstrates how to properly use these fields. Thanks, Ben On Apr 2, 5:19 pm, Bill Freeman wrote: > I know that I used (some revision of) that snippet

Module loading error in django trunk.

2010-05-18 Thread ben
Rev. 13079) I don’t get these errors. Is this a bug, or have I missed some backwards incompatible change? I’ve searched around and came up with nothing? Any insights or suggestions much appreciated. kindly, Ben. Example Error: TypeError at /admin/auth/user/1787/ find_module() takes exactly 3

Re: Module loading error in django trunk.

2010-05-20 Thread ben
On May 18, 9:35 pm, Russell Keith-Magee wrote: > On Tue, May 18, 2010 at 6:12 PM, ben wrote: > > Hi All, > > > After a recent svn update to my copy of Django/trunk I’ve been getting > > a persistent error relating to module loading (see below). I am able > > to c

hyperlinks within admin interface

2010-05-21 Thread Ben
link table). I'd like to be able to create links directly to the questions... Any suggestions much appreciated. Ben -- 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.

Deploying Django on a server with mod_userdir

2010-05-21 Thread Ben
Hi everyone, I'm just starting out with Django and really enjoying it. For a project I am trying to install it on an Apache server at school with multiple users. The userdir module is enabled such that users can create their own websites. I'd like to allow some of these users to tinker with Django.

NullBooleanField default to unknown

2012-03-16 Thread Ben
ves very closely to what I desire, but I don't know what I could replace the False with in: presence = models.NullBooleanField(default=False) in order to make it behave as I would like. Thanks so much for your time, Ben R. -- You received this message because you are subscribed to the Google

Re: unit testing

2013-07-08 Thread ben
On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: > > > > Ah, I missed that in the docs. Thanks. When I renamed it to tests.py > it got picked up. > > But in the django/contrib dirs (e.g. django/contrib/auth) the tests > are in a tests sub dir and are not called tests.py and

Re: unit testing

2013-07-09 Thread ben
Also note that Django 1.6 will bring a better test discovery mechanism. See the full details at https://docs.djangoproject.com/en/dev/releases/1.6/#discovery-of-tests-in-any-test-module Django 1.6 ships with a new test runner that allows more flexibility in the > location of tests. The previous

Django Success Story

2008-02-12 Thread Ben
If you'd like to read about the recent success of a summer project involving Django, read on. I've been playing with django in my spare time for a couple years. I've written a simple blog app, and have half-finished a few sizeable apps, one of which will be put on a vps by the end of the semester

404 on admin media files and mod_python

2008-04-25 Thread Ben
Hello The issue of how to serve the admin media files using mod_python has been dealt with several times before, and AFAICS I've followed the advice given (and the documentation), but I still get a 404 on the admin media files. I've already removed "Apache expert" from my CV. Any suggestion

Re: 404 on admin media files and mod_python

2008-04-25 Thread Ben
> Darryl wrote: > You don't need admin_media in the urls.py file as it shouldn't make it > as far as Django. Thanks for your reply. I agree, but desperation made me doubt what I knew > Unless you've copied the media files from the Django source into your > web root, it needs to point at the ad

Re: 404 on admin media files and mod_python

2008-04-25 Thread Ben
Karen wrote: > If you include the trailing slash on the first part (url-path), then you > need to include it also on the second part. Thanks for your reply. I now have the trailing slash in both places, but still a 404 >> > > Check the error log as well, this will print out the actual file n

Re: 404 on admin media files and mod_python

2008-04-25 Thread Ben
Karen wrote: > You did restart apache after making the change? Yes > the error log that will show the cause of the 404 (assuming the url is > being > handled by apache itself), since it is where you will see the actual file > name apache is trying to access. If you see nothing about the admin

Re: 404 on admin media files and mod_python

2008-04-25 Thread Ben
Karen wrote: > Where in your apache config is the relative to your > Django block?  It sounds like you need to reverse > the order, so that the admin_media location over-rides the Django one, not > vice-versa. Thats it! Your'e a star! I've put the admin_media stuff below the Django block a

website template compatible with django

2007-08-01 Thread Ben
Hi all, I am a total Django newbie. Hence the probably silly questions: There are professional-looking website templates for sale in several places (templatemonster, etc). Can those be used easily with Django ? Do they need to be designed specifically for Django ? Do you know of any vendor that

Detecting changed fields when saving an object

2007-10-30 Thread Ben
ve to update this whenever a new field was added to the model which is both non-DRY and rather tedious. Is there any django way of doing this? Something like: def save(): for all fields in this object: if field is now different: do audit here super(blah, self).save() Cheers

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 7:31 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > > > I'm trying to create an audit trail for a particular model, capturing > > all changes made on the objects. > > You might want t

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 7:31 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > > > I'm trying to create an audit trail for a particular model, capturing > > all changes made on the objects. > > You might want t

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 10:07 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Is there a particular reason you need the before and after, instead of > just the after? Getting the before values would either require an > additional query during your save, or you'd have to overload the > __init__ method to store

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 10:33 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > That's the basic idea, anyway. Hope this helps. Spot on, it was overriding __init__() that does it :) Many thanks, Ben. --~--~-~--~~~---~--~~ You received this message be

Re: geodjango apache vs lighttpd

2008-09-23 Thread Ben Eliott
Yup as you say, it was apache + mod_python switched to lighttpd + fastcgi. Sounds like it could well be mod_python / Apache issue at the root of it. On 23 Sep 2008, at 21:47, Jashugan wrote: > > Did you switched from Apache + mod_python to Lighttpd + FCGI? If so, > are you sure it wasn't a

Re: save existing jpg to model

2008-10-17 Thread Ben Eliott
Hi Steve, Nope, Linux machine... ??? On 17 Oct 2008, at 01:30, Steve Holden wrote: > > [EMAIL PROTECTED] wrote: >> I have users dumping jpgs into a folder within the media root, the >> idea is to monitor this folder and programmatically add the jpgs to >> certain model instances based on a namin

Admin interface crashes when adding a new item with a ForeignKey

2008-11-10 Thread Ben Gerdemann
doing something wrong. Cheers, Ben Environment: Request Method: POST Request URL: http://www.moviemago.com/admin/students/aluno/add/ Django Version: 1.0-final-SVN-unknown Python Version: 2.4.3 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes',

Re: Admin interface crashes when adding a new item with a ForeignKey

2008-11-10 Thread Ben Gerdemann
saves someone else from debugging in the future. For future reference the assertion was: "invalid literal for int(): None" Cheers, Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Intercepting return from new ForeignKey popups? (RelatedObjectLookups.js)

2008-11-16 Thread Ben Gerdemann
ite get my head around what to do. I need someway to intercept the return from the Popup to update fields on my form. Cheers, Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
form = T55VisitasInlineForm, exclude = ('a55_id') ) How can I get this to work??? Grrr... Ideally, I'd like to have a fully custom inline form using "fieldsets," but for now I'll settle for just hiding fields. Cheers, B

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
if it helps for understanding Pais = Parents and Visitas = Visits in Portuguese. Thanks again for any and all help. Cheers, Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: Custom Inline Forms with InlineFormsets

2008-11-17 Thread Ben Gerdemann
) like you described, but I couldn't get it to work. Are you working inside the admin interface? Perhaps that is my problem.... Cheers, Ben On Nov 10, 6:49 pm, John Boxall <[EMAIL PROTECTED]> wrote: > I take it back. > > I over thought it - > > Instead of using a

Re: Custom form/formset for edit inline

2008-11-17 Thread Ben Gerdemann
I'm having exactly the same problem which I posted about here http://groups.google.com/group/django-users/browse_thread/thread/bb4c792f13b2eceb# Have you figured out how to do this? Yours is the third message I've read by someone trying to customize an inline form without any solution. I'm beginni

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
igure out what caused an exception especially if there are no line numbers of my own code. In this case, it's actually the Python syntax and I'm not sure what Django could do if your syntax is wrong, but I sure spent a while tracking this down..

Re: problem enabling the admin interface

2008-11-19 Thread Ben Eliott
installed apps needs 'django.contrib.sessions', http://docs.djangoproject.com/en/dev/topics/http/sessions/#topics-http-sessions On 19 Nov 2008, at 19:42, Bryan Oakley wrote: > > I inherited a django app and I'm trying to enable the admin interface > without much luck. When I try to access the a

Re: Django template tag question

2008-11-19 Thread Ben Eliott
what happens when you go into the python interpreter and write import basic On 19 Nov 2008, at 16:58, goblue0311 wrote: > > I'm implementing the popular basic.blog application, which requires > the inclusion of the basic.inlines project. However, I cannot seem to > get my application to locate t

Re: problem enabling the admin interface

2008-11-19 Thread Ben Eliott
esses I'm finally up > and running. It's been surprisingly difficult, but I'm not tuned in to > the django world so maybe these are all known issues. > > Thanks again! > > On Nov 19, 2:49 pm, Ben Eliott <[EMAIL PROTECTED]> wrote: >> installed apps needs '

Re: Customising slugify filter

2008-11-19 Thread Ben Eliott
Um, what about a regular python function which replaces '/' with '-' then calls slugify On 19 Nov 2008, at 20:44, Nick wrote: > > Hi, > > I have the following strings which is run through the slugify filter > on my site: > > "Business/Executives" > > and it becomes "businessexecutives". I

Re: Help for crontab

2008-11-20 Thread Ben Eliott
recommend you check out django-extensions jobs. http://code.google.com/p/django-command-extensions/ On 20 Nov 2008, at 12:53, laspal wrote: > > hi, > I am writing cron job for my application but run into problem > > from django.core.management import setup_environ > import settings > setup_envi

Implement file upload in admin interface

2008-11-27 Thread Ben Lau
Hi all, I would like to implement a data upload feature in admin interface for my application. A form with file upload field will be show for a data model. The file should be a XML file which is generated by another program and contain more than one record of data. Anybody implemented simila

Re: Implement file upload in admin interface

2008-11-28 Thread Ben Lau
Hi redbaron, My approach is to subclass ModelAdmin to implement a import command . It should need to override the __call__() and create a import_view() function to handle the import form. Example: class XXXAdmin(admin.ModelAdmin): def __call__(self, request, url):

Re: Implement file upload in admin interface

2008-11-30 Thread Ben Lau
hi, It is mush easier then my approach. Thanks a lot! On Fri, Nov 28, 2008 at 9:28 PM, redbaron <[EMAIL PROTECTED]> wrote: > > > My current solution is. > > 1. Define new model Batches: > > class Batches(models.Model): > batchfile = model.FileField(upload_to="noop") > > 2. In admin.py define ne

Re: dynamic mod wsgi

2008-12-09 Thread Ben Eliott
and your directions and hope to report back with some progress. Thanks and Regards, Ben On 9 Dec 2008, at 08:23, Graham Dumpleton wrote: > > > > On Dec 9, 6:53 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: >> Hi, I'm converting to the excellent m

Re: Many to Many entries being duplicated, any ideas?

2008-12-09 Thread Ben Eliott
Do you want something like this? friends_new = models.ManyToManyField("self",symmetrical=False) On 9 Dec 2008, at 09:06, Darthmahon wrote: > > Hi Guys, > > Just bumping this up as I still can't figure out why this is > happening :/ > > On Dec 8, 9:27 pm, Darthmahon <[EMAIL PROTECTED]> wrote: >>

Re: request parsing

2008-12-09 Thread Ben Eliott
request.FILES If this is what you mean, I think this is kind of django 101, i'd recommend having a solid read through the docs which cover all these kind of bases really well. On 9 Dec 2008, at 09:30, Vicky wrote: > > If we send a file by post method to a django function how can we > separa

Re: Many to Many entries being duplicated, any ideas?

2008-12-09 Thread Ben Eliott
hmm, don't know. that's the documented approach. you might want to investigate intermediary tables/models etc. On 9 Dec 2008, at 09:24, Darthmahon wrote: > > Ahh yes possibly. Any downsides to using this? > > On Dec 9, 9:19 am, Ben Eliott <[EMAIL PROTECTED]> wro

Re: dynamic mod wsgi

2008-12-09 Thread Ben Eliott
Understood. Thanks. On 9 Dec 2008, at 10:18, Graham Dumpleton wrote: > > > > On Dec 9, 8:05 pm, Ben Eliott <[EMAIL PROTECTED]> wrote: >> Graham, >> Thank you for coming back personally to such a lowly wsgi question! I >> started reading your email and thinkin

A Top-Level Django Index for the root URL

2008-12-21 Thread Ben Pritchard
e mini-sites that are available? I look forward to any help that someone can offer me. Thanks, Ben p.s.: I've searched the mailing list archives but (not surprisingly) hits for "top-level" "site" "index" "projects" and "list" are pro

Re: dynamic mod wsgi

2008-12-22 Thread Ben Eliott
st i have: WSGIApplicationGroup %{SERVER} WSGIDaemonProcess %{SERVER} ...threads etc WSGIProcessGroup %{SERVER} So this is probably hoplessly wrong also, but if you can give some further pointers that would be most kind. Thanks and Regards, Ben On 9 Dec 2008, at 10:18, Graham Dumpleton wrote: > > >

Re: How to set the from a ModelChoiceField?

2008-12-22 Thread Ben Eliott
I suspect that bots aren't going to follow form submits like this so it doesn't matter. But if you have these GET queries coded into any html elements, thereby becoming part of the sitemap, then it probably will matter. This is a bit of a common sense punt, i'm not an SEO expert, so standi

Re: dynamic mod wsgi

2008-12-23 Thread Ben Eliott
*.stayunstuck.co.uk RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.stayunstuck\.co\.uk$ [NC] RewriteRule . - [E=subdomain:%1] WSGIDaemonProcess test user=ben group=ben threads=10 processes=1 WSGIProcessGroup %{ENV:subdomain} WSGIScriptAlias / /home/ben/mod_wsgi/django.wsgi WSGIApplicationGroup

Re: dynamic mod wsgi

2008-12-23 Thread Ben Eliott
t; > Are all the site instances distinguishable by server name alone? > > Graham > > On Dec 23, 9:00 am, Graham Dumpleton > wrote: >> On Dec 22, 9:44 pm, Ben Eliott wrote: >> >>> Hi Graham, >>> I've finally managed to get back to the wildcard subdomain

Re: Do sth on time ?

2009-01-04 Thread Ben Eliott
Maybe look at it from the point of view of whether you need these items to actually expire on time, or whether you need them to have expired when they're actually accessed from the database. If the latter you could use a method in your model, + a manager function perhaps, to flick the 'expir

Re: Recipe 534109: XML to Python data structure

2009-01-06 Thread Ben Eliott
Perhaps try: http://www.crummy.com/software/BeautifulSoup/ is awesome and has good documentation On 6 Jan 2009, at 15:27, shi shaozhong wrote: > > I am reading in a xml from a web service. I wish to find a Python > script to turn the xml into a Python data array for further > manipulation and t

Re: Circular imports between managers and models

2009-01-06 Thread Ben Eliott
Not that pretty/efficient but you could use contenttype contrib temporarily. IF ClassB has a ForeignKey to Class A could you extract the Class A model from a foreign key via Class B's .meta? Or the Class B could have a callable method which returned the instance of the model you want... No

Re: dynamic mod wsgi

2009-01-11 Thread Ben Eliott
Hi Graham, Just following up on this thread. I replied with some details, but maybe you missed those, or maybe i missed your reply. Or maybe this isn't worth it and i should stop being lazy and just write out the VirtualHost files :) Ben On 23 Dec 2008, at 01:13, Graham Dumpleton

Re: dynamic mod wsgi

2009-01-12 Thread Ben Eliott
Ok, thanks Graham, will do. On 11 Jan 2009, at 10:45, Graham Dumpleton wrote: > > > > On Jan 11, 7:59 pm, Ben Eliott wrote: >> Hi Graham, >> Just following up on this thread. I replied with some details, but >> maybe you missed those, or maybe i missed your reply

Problem with encoding and using ifequal in Django templates

2009-01-27 Thread Ben Gerdemann
throughout the rest of application in both the data, templates and Python code without any problems. Any ideas? Cheers, Ben views.py def test(request): return render_to_response("test.html", { "s1": "dados",

Re: Problem with encoding and using ifequal in Django templates

2009-01-27 Thread Ben Gerdemann
Sometimes there's nothing like describing a problem to someone else to help you solve it. :) I should have marked the Python strings as Unicode like this and everything works now: def test(request): return render_to_response("test.html", { "s1": u"d

Converting queryset filter() strings to their fields?

2009-02-06 Thread Ben Gerdemann
Hello, I think the best why to explain my question is with an example. I have a model T60CursoAdmin and a query string "a21__a21_ano" that I can use to search with like this: T60CursoAdmin.objects.filter(a21__a21_ano=2008) The models look like this: class T60Curso(models.Model): a21 = mode

signal connection

2009-02-10 Thread Ben Eliott
to do with an import conflict? The second app's models.py file already imports a class from the signal's models.py file. Any suggestions very welcome, thanks! Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Custom template tags in admin with hacking to source?

2009-02-16 Thread Ben Gerdemann
gs or adding a new file in the directory. I tried adding a templatetags directory to my app, but it doesn't work because Django only searches for template tags in the templatetag directory of the active app. Any ideas about how to do this without hacking the source? C

Re: get_absolute_url() and related models

2009-02-24 Thread Ben Davis
Thank you so much! It's funny because I had originally tried category__slug, not sure why it didn't occur to me to use self.category.slug ! Also, I'm glad to have learned about select_related() -- that's exactly what I was looking for! On Mon, Feb 23, 2009 at 6:36 PM, Malcolm Tredinnick < m

Compressed fixtures?

2009-03-06 Thread Ben Davis
http://docs.djangoproject.com/en/dev/ref/django-admin/#compressed-fixtures The docs say that you can use compressed fixtures, but I haven't gotten this to work. For example, I have myapp/fixtures/myfixture.yaml.gz, but when I run ./django-admin.py loaddata myapp/fixtures/myfixture.yaml, it just

Re: Compressed fixtures?

2009-03-07 Thread Ben Davis
Ahh. Searching for "compressed fixtures" on djangoproject.com under the "1.0" documentation option reveals the following page: http://docs.djangoproject.com/en/dev/ref/django-admin/?from=olddocs That page has the "1.0 Docs" label, so I'm guessing this is an error in the documentation? Is there

I can't decide on a migration framework

2009-03-07 Thread Ben Davis
I've been looking into both the "South" and "django-evolution" migration frameworks. There are things I like about both of them, although I'm leaning towards django-evolution. The thing I like about django-evolution is that migrations are described in the same "language" as your model, that is,

Re: I can't decide on a migration framework

2009-03-09 Thread Ben Davis
anges needed when you run syncdb. So in order to controll evolutions you would need to change to model fields. On 7 Mar., 23:59, Ben Davis wrote: > I've been looking into both the "South"... > claims<http://south.aeracode.org/wiki/Alternatives>to have started the > p

Re: I can't decide on a migration framework

2009-03-09 Thread Ben Davis
Thanks Russ! Your insight is greatly appreciated. On Mon, Mar 9, 2009 at 8:58 PM, Russell Keith-Magee wrote: > > On Tue, Mar 10, 2009 at 8:23 AM, Ben Davis wrote: > > are you saying that django-evolution does not support migrating between > > "versions" (ie up and

Reading data from database tied to another Django project?

2009-07-10 Thread Ben Kreeger
Here's the situation: I've got two projects, both Django. One is a simple, public-facing website that renders a library of reStructuredText files, as well as a couple of simple forms using the Forms API. The other is a back-end that requires a login from a member of our staff, and contains databas

Re: Finding a Django expert to review my code

2009-07-30 Thread Ben Atkin
I'd probably try emailing some of the top Django developers. This seems like it would be a buyer's market, due to the job being short and fun for a dedicated Django dev. Don't hire a noob like me. ;) http://code.djangoproject.com/wiki/DevelopersForHire Ben On Thu, Jul 30, 2009 a

Re: Concurrent Web Access and Edits

2009-08-12 Thread Ben Moran
On Tue, Aug 11, 2009 at 10:14 PM, Doug Blank wrote: > New Django user here with a question about the client side: Is there > built-in support for dealing with concurrent edits? ... > Maybe you want the Django condition decorator, which lets you use HTTP headers to send an ETag or Modified da

Re: Return FK model

2009-09-03 Thread Ben Davis
It looks you're setting a many-to-many reflexive (circular) relationship between users. It seems it would be better to add a ManyToManyField on the User model, eg: class User(models.Model): ... friends = ManyToManyField(User) Then you could just use "user.friends" On Thu, Sep 3, 200

Re: Return FK model

2009-09-03 Thread Ben Davis
Make sense? On Thu, Sep 3, 2009 at 10:17 AM, Yanik wrote: > > Well, I can't add very well add fields to the Auth.User. But even if I > could, user.friends would get me instances of "Friend" model, not > "User" model. > > On Sep 3, 11:13 am, Ben Dav

Re: Return FK model

2009-09-03 Thread Ben Davis
r relation should be OneToOneField, not ForeignKey. On Thu, Sep 3, 2009 at 10:49 AM, Javier Guerra wrote: > > On Thu, Sep 3, 2009 at 10:41 AM, Ben Davis wrote: > > The django docs suggest using a UserProfile model when you need to add > more > > infor

Re: are you using mptt, treebeard or something else?

2009-09-03 Thread Ben Davis
>From what I understand, Treebeard has better performance, but mptt has (I think) been around longer. I've messed around w/ mptt, but looking through treebeards benchmarks, it looks like treebeard might be more well thought out. As far as admin support goes, I don't think either has "offic

Re: create non-form widgets like a ajax driven table

2009-09-07 Thread Ben Davis
In django terms, a table is not a widget. Widgets are basically different input methods for form fields. Django's admin app has a built-in list view (I think it's called changelist) which you can customize or override. It basically just takes some effort to dig into the admin contrib app to se

Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Ben Kreeger
I've got a model that has an ImageField, and a ModelForm that uses this model. I've got my template set up using the form fields, and my form tag is set up with enctype="multipart/form-data" so the picture upload works. When I use the included Django development server (runserver command), I can

Authentication for static files

2009-09-26 Thread Ben Davis
I would like to be able to serve files that were uploaded via the admin site; for example, when someone clicks on the "Currently:" file link in the changeform. However, I also have the following requirements: 1. The file should only be accessible when authenticated via django's auth system

Re: Authentication for static files

2009-09-27 Thread Ben Davis
t; > On Sep 27, 3:08 am, Ben Davis wrote: > > I would like to be able to serve files that were uploaded via the admin > > site; for example, when someone clicks on the "Currently:" file link in > the > > changeform. However, I also have the following requirements:

Re: can't compare datetime.datetime to datetime.date

2008-05-20 Thread Ben Firshman
The date() method of the datetime object is what you probably want. See the documentation: http://docs.python.org/lib/datetime-datetime.html Ben On 20 May 2008, at 09:56, vance ma wrote: > In django ;How to compare datetime.datetime and datetime.d

Re: Django in a HA cluster web services application with some near real time elements

2008-05-21 Thread Ben Ford
and a lot of trouble finding where the originate! Our code uses threadlocal in some places - I'm not sure how similar threadlocal is to 'threading' (if anyone can enlighten me I'd appreciate it!), but I think it might be causing a few of

Re: Sydney - Django Contracts - Mobile/Web Dev

2008-05-29 Thread Ben Ford
Hi Glen, Have you tried posting this on djangogigs.com..? You might get a wider readership there :-) Ben 2008/5/29 Wunderkind <[EMAIL PROTECTED]>: > > Hi, > > A client of mine located in North Sydney is looking for a couple of > contractors who have experience developing i

Re: Tests in files other than tests.py and models.py

2008-06-25 Thread Ben Ford
places, and I can use fixtures in my doctests. I find it pretty flexible, but I'm not really 100% convinced it's the best way to go about this, so I'd be interested in hearing from others. Cheers, Ben 2008/6/25 Andrew Fong <[EMAIL PROTECTED]>: > > A quick browse of

Re: Do you code django with Komodo?

2008-06-25 Thread Ben Ford
> BTW: would anybody be interested in contributing to a Komodo-Django > extension with shortcuts to manage.py etc., modeling wizards and so on? Hell yeah, is it relatively straightforward or very involved? I know python pretty well, but firefox/komodo extensions are a bit of a black art

"Eval" in templates?

2008-07-04 Thread Ben Kovitz
ne that decides which button to render); or use {% if %} tags in blah.html (kind of ugly, involves difficulties with parameter-passing, and we need to do this all over the place, though we could stuff the {% if %} logic into an included template). Ben Kovitz http://decisionero.com --~--~-

Re: "Eval" in templates?

2008-07-05 Thread Ben Kovitz
Thanks for the encouragement, Alex. This was so easy, it should be a first lesson in how to write a custom tag. It took about 15 minutes and worked the first time! from django import template register = template.Library() @register.tag(name="eval") def do_eval(parser, token): try: t

  1   2   3   4   >