Re: Preventing JOIN while checking if a self referencing FK is null

2012-03-22 Thread diafygi
Is there a reason why editor_id is meant to raise a field error? -Daniel On Mar 21, 12:05 pm, diafygi wrote: > >>> Blog.objects.filter(editor_id=None) > > FieldError: Cannot resolve keyword 'editor_id' into field. > > This was actually an offered answer in the previous

implement form for listfield

2012-03-22 Thread rohit jangid
hi, I'm using mongodb as my database and djangomongodb engine for the orm layer. I have a basic model let say 'A' which I can use in admin module and objects in db than I have another model which has a field like this class B fieldname ListField(EmbeddedModelField('A')) the problem is that when

ModelForms

2012-03-22 Thread hack
I think I shot myself in the foot using ModelForms to generate all of my html forms. Is there any way to use a stylesheet when your forms are generated from ModelForms? I've tried everything and cannot get it to work. I've tried directly importing the css files, I've tried loading them from

Re: Using _set.all in template when ForiegnKey is linked to Self

2012-03-22 Thread Daniel Roseman
On Thursday, 22 March 2012 01:12:21 UTC-7, Jam wrote: > > Hi All, > > I have a model where it can link to itself using ForeignKey('self'). This > is so I can have parent and child objects. > > I have called the parent and in the template I want to be able to access > all the child objects. > > I

Django-1.4c2 logging issue on Snow Leopard

2012-03-22 Thread Jeff Heard
Hi all. I just created a new Django-1.4 project and got this error: Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) File "/Users/jeffersonheard/Source/geoanalytics/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in

Re: Autofill dropdown with django

2012-03-22 Thread Sandro Dutra
I think it's more Javascript/AJAX than Django, obviously you'll need to do a function that uses HttpRequest.is_ajax(), but in the end, the core of this code is more Javascript/AJAX than Django. 2012/3/22 Karthik Abinav > hey, > > I needed a autocomplete utility in one

Re: Autofill dropdown with django

2012-03-22 Thread Nikhil Verma
Hi Abhinav If i understand you correctly take a look at django-ajax-select. Home-page: http://code.google.com/p/django-ajax-selects/ This is an autocomplete box which works in the following way :- Hope it helps you !!! Let say we have a username textbox(which is ajax-selct field) so i type Ab

Autofill dropdown with django

2012-03-22 Thread Karthik Abinav
hey, I needed a autocomplete utility in one of my applications and I was wondering if django provides any such option for that. Basically my need is a box where user starts typing some name and as he types I need a list of suggested autocompletion, to be provided. Something like how when a user

Re: [1.4c2] The storage backend of the staticfiles finder doesn't have a valid location.

2012-03-22 Thread Micky Hulse
Hi Bill, thanks so much for you pro help and quick reply, I really appreciate it! :) On Thu, Mar 22, 2012 at 4:32 AM, Bill Freeman wrote: > Just a shot in the dark, but you probably want to leave DefaultStorageFinder > commented out ... That did the trick! Thank you so much,

Weird stacktrace coming from manage.py test

2012-03-22 Thread Jeff Heard
Has anyone seen this before? Am I missing something? This hasn't even gotten to my code yet. I'm using this in my settings.py: TEST_RUNNER = 'django.contrib.gis.tests.GeoDjangoTestSuiteRunner' I have a template PostGIS database setup properly. And I'm running the stable release of Django

Re: Is there a place for new Django specialized hosting?

2012-03-22 Thread shacker
Agreed - hosting of any kind is a tough business these days - it's become so commoditized that prices are rock bottom and customer expectations extremely high. And there are tons of Django-optimized hosts out there already - search for "django hosting" for listings and comparative sites before

Re: Using “Schemas” with MySQL

2012-03-22 Thread Tom Evans
On Thu, Mar 22, 2012 at 1:29 PM, Peter of the Norse wrote: > In our legacy system at work, we're using different different databases on > the same sever at the same time. It looks like ”Select * From client_a.user > Inner Join common.table On…”. I know that ticket 6148 

Multi form or big form..

2012-03-22 Thread Xavier Pegenaute
Hi, I need to show a view with a list of users, every user can be joined to an event or not. This is modelled with User (about 2k instances) and a JointToEvent class. This last class has a relation to User and a status field. This field can be: "Joined" or "Waiting to be paid" (CHOICE field).

Re: twitter timeline

2012-03-22 Thread Anoop Thomas Mathew
Hi, https://twitter.com/status/user_timeline/.json This would get you latest public tweets as json. This was good enough for my application. See if that helps. If you need twitter authentication and more features, you can use tweepy. Thanks, Anoop Thomas Mathew atm ___ Life is short, Live it

Re: twitter timeline

2012-03-22 Thread Amit
Hi Randa, I have used tweepy. Its easy to use. doc link: http://packages.python.org/tweepy/html/ On Mar 21, 7:00 pm, Randa Hisham wrote: > hey > iam going to make an app that read the timeline of a user from twitter what > django package do you recommend? > > -- > Randa

Using “Schemas” with MySQL

2012-03-22 Thread Peter of the Norse
In our legacy system at work, we're using different different databases on the same sever at the same time. It looks like ”Select * From client_a.user Inner Join common.table On…”. I know that ticket 6148 is still a long way from being included, but I was wondering if there is a workaround.

Templated rich-text egg for Django?

2012-03-22 Thread Alec Taylor
Good morning, We've all seen document templates in a variety of systems, such as PowerPoint, MailChimp and Google Docs. I would like to utilise the same sorts of capabilities on my website. The following features I require: • Create a library of document templates • Allow others to pick a

Re: Is there a place for new Django specialized hosting?

2012-03-22 Thread Andre Terra
Forgive me if I sound pessimistic, I'm just a hobbyist developer offering my most sincere 2 cents. There are many services that offer similar features and sometimes even more. From a business perspective, the only way to thrive in this market is by having technology that provides competitive

Re: sql for Many To Many Field in existing django model

2012-03-22 Thread Joel Goldstick
On Thu, Mar 22, 2012 at 6:55 AM, Nikhil Verma wrote: > Hi All > > I want to add a ManyToManyField  to an existing django model. > > I can use sql app_name and see the statement. > > My models > > Class Visit(modes.Model): >   x = something >   . .. >   .. and so

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread kenneth gonsalves
On Thu, 2012-03-22 at 05:25 -0700, Stodge wrote: > No I need MEDIA_ROOT, I want to experiment with: > > > > Thanks in the view: from django.conf import settings and send settings.MEDIA_ROOT to the template or build a templatetag to do the same thing. -- regards Kenneth Gonsalves -- You

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Stodge
All good points thanks. I'm only experimenting and learning so this won't hit production. Point taken though. :) On Mar 22, 7:30 am, Tom Evans wrote: > On Thu, Mar 22, 2012 at 12:25 PM, Stodge wrote: > > No I need MEDIA_ROOT, I want to experiment

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Tom Evans
On Thu, Mar 22, 2012 at 12:25 PM, Stodge wrote: > No I need MEDIA_ROOT, I want to experiment with: > > > > Thanks > MEDIA_ROOT is a file-system location, not a URL-space location, and should not be exposed in templates. It is nonsense to use media root as a prefix to the

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Davinir F Campos Jr
Stoge, you DO need MEDIA_URL in turn to build the URL in which script src is based on. MEDIA_ROOT is the (complete) physical path to the file. Do you want to expose your filesystem? [ ]s Davinir 2012/3/22 Stodge > No I need MEDIA_ROOT, I want to experiment with: > > > >

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Stodge
No I need MEDIA_ROOT, I want to experiment with: Thanks On Mar 22, 7:22 am, kenneth gonsalves wrote: > On Thu, 2012-03-22 at 05:11 -0700, Stodge wrote: > > In my template: > > > MEDIA_ROOT: {{MEDIA_ROOT}} > > > But all I see is: > > > MEDIA_ROOT: > > > So MEDIA_ROOT is

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread kenneth gonsalves
On Thu, 2012-03-22 at 05:11 -0700, Stodge wrote: > In my template: > > MEDIA_ROOT: {{MEDIA_ROOT}} > > But all I see is: > > MEDIA_ROOT: > > So MEDIA_ROOT is blank or doesn't exist. Did I miss something?

Re: Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Stodge
Oh that's surprising; the media context processor only creates MEDIA_URL. On Mar 22, 7:11 am, Stodge wrote: > I'm trying to reference MEDIA_ROOT in my template but it's blank. I > have MEDIA_ROOT defined in settings.py: > > MEDIA_ROOT =

Accessing MEDIA_ROOT in templates, always blank/missing

2012-03-22 Thread Stodge
I'm trying to reference MEDIA_ROOT in my template but it's blank. I have MEDIA_ROOT defined in settings.py: MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'static') I have the correct context processor: TEMPLATE_CONTEXT_PROCESSOR = (

Re: [1.4c2] The storage backend of the staticfiles finder doesn't have a valid location.

2012-03-22 Thread Bill Freeman
On Thu, Mar 22, 2012 at 2:22 AM, Micky Hulse wrote: > I must be overlooking something obvious. My error: > > > > The static files collect just fine (currently, I just have admin files > to collect); the above error just shows up every time I run >

sql for Many To Many Field in existing django model

2012-03-22 Thread Nikhil Verma
Hi All I want to add a ManyToManyField to an existing django model. I can use sql app_name and see the statement. My models Class Visit(modes.Model): x = something . .. .. and so on # finally Here i want to add that field research protol research_protocol =

Re: Help with django-paypal anyone?

2012-03-22 Thread Stanwin Siow
ok thank you. I'll take a look tonight. Cheers Best Regards, Stanwin Siow On Mar 22, 2012, at 6:30 PM, Daniel Hilton wrote: > On 22 March 2012 10:20, Stanwin Siow wrote: >> hey daniel, >> >> I used the johnbox version. >> > > I found this version has more

Re: Help with django-paypal anyone?

2012-03-22 Thread Daniel Hilton
On 22 March 2012 10:20, Stanwin Siow wrote: > hey daniel, > > I used the johnbox version. > I found this version has more uptodate bug fixes and features: https://github.com/dcramer/django-paypal HTH Dan > Should be ok right? > > Best Regards, > > Stanwin Siow > > >

Re: Help with django-paypal anyone?

2012-03-22 Thread Stanwin Siow
hey daniel, I used the johnbox version. Should be ok right? Best Regards, Stanwin Siow On Mar 22, 2012, at 6:01 PM, Daniel Hilton wrote: > On 22 March 2012 05:47, Jonathan Baker wrote: >> You'll need to enable the CSRF middleware, adjust your view and make

Re: Admin - how to get all registeres models in templatetag?

2012-03-22 Thread rohit jangid
I'm using the default admin for my purpose there was a time when I was thinking the same but I didn't wanted to reinvent the wheel so what different features are u planning for it which are not available in default admin? On Thu, Mar 22, 2012 at 3:33 PM, galgal wrote:

Admin - how to get all registeres models in templatetag?

2012-03-22 Thread galgal
I'm writing a custom admin stuff and need to get all registered models in Admin. Is this possible? I need it to make some custom views on admin index page. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web

Re: Help with django-paypal anyone?

2012-03-22 Thread Daniel Hilton
On 22 March 2012 05:47, Jonathan Baker wrote: > You'll need to enable the CSRF middleware, adjust your view and make use of > the {% csrf_token %} template tag in your template. Details can be found > here: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ > >

Using _set.all in template when ForiegnKey is linked to Self

2012-03-22 Thread Jam
Hi All, I have a model where it can link to itself using ForeignKey('self'). This is so I can have parent and child objects. I have called the parent and in the template I want to be able to access all the child objects. I have been using the _set.all template command on the field but it

Re: Migrating wrapped function-based generic view to class-based generic view

2012-03-22 Thread saxon75
So, what I've come up with is subclassing ListView and then decorating the dispatch method like so: def checkNodeExists(): def decorator(func): def inner(request,*args,**kwargs): try: object = Node.objects.filter(section__keyword=kwargs['sect'], published=True)[0]

Using ForeignKey.on_delete and models.SET

2012-03-22 Thread Mihail
Looking at documentationon using ForeignKey.on_delete with models.SET I can't find a way to pass an object being deleted to callable get_sentinel_user to correctly choose new value for foreign key field. Any advice on how

[1.4c2] The storage backend of the staticfiles finder doesn't have a valid location.

2012-03-22 Thread Micky Hulse
I must be overlooking something obvious. My error: The static files collect just fine (currently, I just have admin files to collect); the above error just shows up every time I run collectstatic. Settings: STATIC_ROOT = '/home/billy/webapps/xyz_static/' STATIC_URL