Signal handler not work

2013-01-17 Thread yillkid
Hi all

I want save B model when A mode has been saved,
my code as below :
http://codepad.org/4ogGh6ru

But not works, anybody help me ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uU8B3kq3fKwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django: creating tag groups

2013-01-17 Thread Sammael
Amirouche, thank you very much.
jQuery solution is quite interesting but it's more complicated for me to 
implement. So I think I gonna use your first idea =). django-mptt is very 
simple to install and it's well documented.
Thank you very much. Your help is inestimable.

среда, 16 января 2013 г., 17:01:21 UTC+4 пользователь Amirouche написал:
>
>
> 2013/1/16 Sammael 
>
>> Unfortunately, I don't know how it should be. Also I believe your idea of 
>> trees is much simpler and cleaner and thus much better.
>>
>> I've installed django-mptt, and it works like a charm. But I'm worried it 
>> would be difficult to upgrade to a new Django version if I use third-party 
>> applications. So I was trying to implement similar approach using 
>> ForeignKey to self, just like django-mptt does:
>>
>
> Sorry, I wasn't clear, I was thinking only thinking about a tree widget 
> not a full blown hierarchical tags which can be indeed a pain.
>
> like the following:
> - http://www.jstree.com/
> - https://github.com/bombino/jquery-tree-select
> - http://code.google.com/p/jquery-option-tree/
>
> at least jquery-tree-select use only one select element in html + 
> javascript, so in python it's just a matter a formatting properly the 
> options:
>
> << [...] transforms it into a select box that just shows (none), Category 
> 1, and Category 2. Then when you click on Category 1, a new select box pops 
> up showing Subcategory 1 and Subcategory 2.>>
>
> HTH
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/W0NeT7ZwS28J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Issues with MAMP

2013-01-17 Thread Nikolas Stevenson-Molnar
Ok, looks like perhaps I spoke to soon. Seems there are a couple of gotchas in 
using Django with an existing MAMP installation. Have you seen this? 
http://tom.londondroids.com/2012/05/setting-up-django-with-mamp-on-mac-os-x-lion-in-steps/

_Nik

On Jan 17, 2013, at 8:16 PM, Nikolas Stevenson-Molnar  
wrote:

> I don't see any reason MAMP should preclude you from using Django /w MySQL. 
> Can you detail the error(s) you're seeing?
> 
> _Nik
> 
> On Jan 17, 2013, at 6:10 PM, beee bello  wrote:
> 
>> I apologize in advance if this topic has already been addressed.
>> 
>> This is my first time EVER using Python and, of course, Django. I have MAMP 
>> installed in my laptop and it seems to be stopping me from connecting Django 
>> to MySQL. I am a student and my other classes use MAMP so uninstalling isn't 
>> so much an option. Is there anywhere I can be directed to resolve this 
>> problem? 
>> 
>> Thank you very much for your help!
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/NEhNYUzrOd0J.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Issues with MAMP

2013-01-17 Thread Nikolas Stevenson-Molnar
I don't see any reason MAMP should preclude you from using Django /w MySQL. Can 
you detail the error(s) you're seeing?

_Nik

On Jan 17, 2013, at 6:10 PM, beee bello  wrote:

> I apologize in advance if this topic has already been addressed.
> 
> This is my first time EVER using Python and, of course, Django. I have MAMP 
> installed in my laptop and it seems to be stopping me from connecting Django 
> to MySQL. I am a student and my other classes use MAMP so uninstalling isn't 
> so much an option. Is there anywhere I can be directed to resolve this 
> problem? 
> 
> Thank you very much for your help!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/NEhNYUzrOd0J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Issues with MAMP

2013-01-17 Thread beee bello
I apologize in advance if this topic has already been addressed.

This is my first time EVER using Python and, of course, Django. I have MAMP 
installed in my laptop and it seems to be stopping me from connecting 
Django to MySQL. I am a student and my other classes use MAMP so 
uninstalling isn't so much an option. Is there anywhere I can be directed 
to resolve this problem? 

Thank you very much for your help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/NEhNYUzrOd0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deployment and user libraries (builds on the Django tutorial)

2013-01-17 Thread Alex Mandel
On 01/17/2013 12:11 PM, Frederik T wrote:
> I've worked my way through the Django tutorial successfully, up to 
> https://docs.djangoproject.com/en/dev/intro/reusable-apps/ which worked for 
> the development test server.
> I have refactored out the polls application and turned it into a python 
> package, as suggested, which I then installed as a local user library via "p
> ython setup.py install --user"
> This worked for the dev server as well.
> 
> After that I set up apache and mod_wsgi and configured apache to bind the 
> path to the application to /test/
> (WSGIScriptAlias /test/ /tmp/test/apache/django.wsgi, chowned to 
> apache:apache)
> which also worked.
> What did not work, however, was apache, or python/django finding the polls 
> package.
> 
> I am pretty new to python/django but I am pretty sure that I should 
> relocate the polls package.
> (currently @ /home/me/.local/lib/python2.7/site-packages/)
> Where is the best place to put it?
> Is there a better way to do this altogether?
> 
> 
> 

If you're going to install it as a python package, either install it to
the system or to the user that mod_wsgi executes under or into a python
virtualenv. Basically you need to ensure that it's on the python path
for the user running the wsgi. You can add additional paths to the wsgi
to make sure it gets picked up too.

I also assume that the django site that your wsgi script points at has
your app in the settings.py under Installed Apps.

Enjoy,
Alex

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Deployment and user libraries (builds on the Django tutorial)

2013-01-17 Thread Frederik T
I've worked my way through the Django tutorial successfully, up to 
https://docs.djangoproject.com/en/dev/intro/reusable-apps/ which worked for 
the development test server.
I have refactored out the polls application and turned it into a python 
package, as suggested, which I then installed as a local user library via "p
ython setup.py install --user"
This worked for the dev server as well.

After that I set up apache and mod_wsgi and configured apache to bind the 
path to the application to /test/
(WSGIScriptAlias /test/ /tmp/test/apache/django.wsgi, chowned to 
apache:apache)
which also worked.
What did not work, however, was apache, or python/django finding the polls 
package.

I am pretty new to python/django but I am pretty sure that I should 
relocate the polls package.
(currently @ /home/me/.local/lib/python2.7/site-packages/)
Where is the best place to put it?
Is there a better way to do this altogether?




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/po9DbCOI2kIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



quantize result has too many digits for current context

2013-01-17 Thread Fellipe Henrique
Hello,

I have this model:

class ItensPedido(models.Model):
idvenda_pedido_itens = models.IntegerField(u'Código', primary_key=True,
null=False)
idvenda_pedido = models.ForeignKey('Pedido',
db_column='idvenda_pedido', null=False, blank=False)
idproduto = models.ForeignKey('Produto', db_column='idproduto',
verbose_name=u'Produto', null=False, blank=False)
qnt = models.IntegerField(verbose_name=u'Quantidade', null=False,
blank=False, default=1)
preco_unit = models.DecimalField(u'Preço Unit.', max_digits=12,
decimal_places=4, null=False, default=0)
valor_total = models.DecimalField(u'Vlr. Total', max_digits=12,
decimal_places=4, null=False, default=0)

class Meta:
managed = False
db_table = 'venda_pedido_itens'


and in my template I try to use: {{ form.idpedido }}

but when I`m use this, django show me this error:

quantize result has too many digits for current context

I have lookup the internet and I see some error like this, but always about
Decimals fields.. but in my case this error appears in Foreign Key field.

My question is: Why this error appears? How can I fix this?

Thanks for all,

Regards,
T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

*"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
morales ad Lucilium,
Lucius Annaeus Seneca)

*"Any intelligent fool can make things bigger, more complex, and more
violent. It takes a touch of genius -- and a lot of courage -- to move in
the opposite direction."*
Albert Einstein (March 14th 1879 – April 18th 1955)

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help - how to deploy to nginx in windows

2013-01-17 Thread Nikolas Stevenson-Molnar
Actually, it looks like those are Nginx builds for cygwin. If you want
native Windows builds, the Nginx site itself has those:
http://nginx.org/en/download.html

_Nik

On 1/17/2013 11:52 AM, Nikolas Stevenson-Molnar wrote:
> Here's an Nginx package for Windows:
> http://kevinworthington.com/nginx-for-windows/
>
> Once you have Nginx installed, configuration is about the same as for
> any other platform. The gunicorn site has an example Nginx
> configuration you can adapt: http://gunicorn.org/#deployment
>
> You also need to run gunicorn itself. You can install it with pip (if
> you haven't already). Then there are several ways to run it; just have
> a look at their docs. I usually do something like: gunicorn --daemon
> myproject.wsgi:application
>
> Keep in mind that gunicorn won't auto-reload your project when you
> change the code (like the Django dev server does) so when you make
> updates, you'll need to restart gunicorn.
>
> _Nik
>
> On 1/17/2013 11:34 AM, frocco wrote:
>> Thanks,
>>
>> Are there any examples on how to get this up and running on windows?
>>
>> On Thursday, January 17, 2013 10:45:26 AM UTC-5, frocco wrote:
>>
>> Hello,
>>
>> If I create a base django app, how can I get it to run using
>> nginx in windows?
>> I keep getting 404 errors.
>>
>> Thank you
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/vX6-aRqt7SwJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help - how to deploy to nginx in windows

2013-01-17 Thread Nikolas Stevenson-Molnar
Here's an Nginx package for Windows:
http://kevinworthington.com/nginx-for-windows/

Once you have Nginx installed, configuration is about the same as for
any other platform. The gunicorn site has an example Nginx configuration
you can adapt: http://gunicorn.org/#deployment

You also need to run gunicorn itself. You can install it with pip (if
you haven't already). Then there are several ways to run it; just have a
look at their docs. I usually do something like: gunicorn --daemon
myproject.wsgi:application

Keep in mind that gunicorn won't auto-reload your project when you
change the code (like the Django dev server does) so when you make
updates, you'll need to restart gunicorn.

_Nik

On 1/17/2013 11:34 AM, frocco wrote:
> Thanks,
>
> Are there any examples on how to get this up and running on windows?
>
> On Thursday, January 17, 2013 10:45:26 AM UTC-5, frocco wrote:
>
> Hello,
>
> If I create a base django app, how can I get it to run using nginx
> in windows?
> I keep getting 404 errors.
>
> Thank you
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/vX6-aRqt7SwJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help - how to deploy to nginx in windows

2013-01-17 Thread frocco
Thanks,

Are there any examples on how to get this up and running on windows?

On Thursday, January 17, 2013 10:45:26 AM UTC-5, frocco wrote:
>
> Hello,
>
> If I create a base django app, how can I get it to run using nginx in 
> windows?
> I keep getting 404 errors.
>
> Thank you
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/vX6-aRqt7SwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types in models/fields/related.py line 955

2013-01-17 Thread Derek Edwards
Greetings - 

I'm not sure if this is a bug or if I'm unknowingly doing something that I 
ought not, but I started encountering this exception when I switched my 
site from debug to production:


Traceback (most recent call last):
>
>  File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/handlers/base.py",
>  
> line 111, in get_response
>response = callback(request, *callback_args, **callback_kwargs)
>
>  File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/contrib/auth/decorators.py",
>  
> line 20, in _wrapped_view
>return view_func(request, *args, **kwargs)
>
>  File "/var/django/acclaimd2/program/api.py", line 813, in 
> put_interview_request
>interview_request_json['email'])
>
>  File "/var/django/acclaimd2/program/models.py", line 205, in create
>referral=Referral()
>
>  File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/db/models/base.py",
>  
> line 349, in __init__
>val = field.get_default()
>
>  File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/db/models/fields/related.py",
>  
> line 955, in get_default
>if isinstance(field_default, self.rel.to):
>
> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes 
> and types
>

Here's the Referral model for your reference:

> class Referral (models.Model):
> opening = 
> models.ForeignKey(Opening,related_name='referrals',null=False,blank=False)
> origin_request = 
> models.ForeignKey('common.request',related_name='referrals',null=True,default=None)
> candidate = 
> models.ForeignKey(User,related_name='referrals',null=False,blank=False)
> intro = models.TextField(max_length=1000,null=False,blank=False)
> experience = models.TextField(max_length=5000,null=False,blank=False)
> email = models.CharField(max_length=255,null=False,blank=False)
> phone = 
> models.CharField(max_length=255,null=False,blank=True,default='')
> 
> @staticmethod
> def create(opening,origin_request,candidate,intro,experience,email):
> referral=Referral()
> referral.opening=opening
> referral.origin_request=origin_request
> referral.candidate=candidate
> referral.intro=intro
> referral.experience=experience
> referral.email=email
> referral.save()
> return referral
> 
> def __unicode__(self):
> return u"%s" % self.id
>

Again, this works perfectly in DEBUG mode but begins firing off exception 
emails to me the minute I switch off debug.  I've been hitting my head 
against the wall for the better part of the day trying to figure out what's 
going on.  Any help would be greatly, greatly appreciated.

Thank you!

Derek 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/MA5JAIhRJ-IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Working example on django-search-lucene

2013-01-17 Thread Barun Saha
Hello,

Could anyone please provide a working example on django-search-lucene? I 
have been going through this 
tutorial,
 
but ending up with an error while trying to search:

type object 'Document' has no attribute 'objects_search'

 Request Method: GET  Request URL: 
http://127.0.0.1:8000/app/search/?query=d=Search  Django Version: 
1.2.1  Exception Type: AttributeError  Exception Value: 

type object 'Document' has no attribute 'objects_search'

 Exception Location: /home/user/codes/project/app/views.py in search, line 
24  Python Executable: /usr/bin/python  Python Version: 2.6.5
Django version is 1.2.1. The models.py contains:

from django.db import models
from search import manager

class Document(models.Model):
class Admin(models.Model):
pass

title = models.URLField(max_length=300, blank=False, null=False, )
content = models.URLField(max_length=300, blank=False, null=False, )
time_added = models.DateTimeField(auto_now_add=True, )
path = models.FilePathField(blank=False, null=False, )
objects = models.Manager()
objects_search =  manager.Manager()  # add search manager

def __unicode__(self):
return "%s" % self.title

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QPk1HxrXiUwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help - how to deploy to nginx in windows

2013-01-17 Thread Nikolas Stevenson-Molnar
Nginx is just a proxy server, you still need something behind it to run
your Django project. I recommend gunicorn (http://gunicorn.org/). It's
easy to use and is commonly used with Nginx.

_Nik

On 1/17/2013 7:45 AM, frocco wrote:
> Hello,
>
> If I create a base django app, how can I get it to run using nginx in
> windows?
> I keep getting 404 errors.
>
> Thank you
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/eeQT6VYHS8EJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Looking for a Django opportunity to pursue...

2013-01-17 Thread Robert Steckroth
Hello, I am actively seeking a opportunity to develop Django applications.
If there are any professionals
seeking to grow in this area, feel free to respond via this address. Also,
I have other soundly developed skills
in the Systems/Software/Web field. Thanks, Robert Steckroth


-- 
Bust0ut, Surgemcgee: Systems/Web/Software Engineer

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can't resolve dependencies error in dumpdata.

2013-01-17 Thread wyleu
Sub classing a self referring class with natural keys from a Base class 
generates an error on dumpdata.

c:\dev\chris\bugdemo>manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table bug_template_extends
Creating table bug_template_includes
Creating table bug_template

You just installed Django's auth system, which means you don't have any 
superusers defined.
Would you like to create one now? (yes/no): no
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

c:\dev\chris\bugdemo>manage.py dumpdata
Error: Can't resolve dependencies for bug.Template in serialized app list.

Here's the model.

from django.db import models

class BaseManager(models.Manager):
def get_by_natural_key(self, name, date_created):
return self.get( name=name, date_created=date_created,)

class Base(models.Model):
objects = BaseManager()

date_created   = models.DateTimeField(auto_now_add = True )
date_modified  = models.DateTimeField(auto_now = True )
name   = models.CharField(max_length = 100, default = '.')
description= models.TextField(default = '.')

class Meta:
abstract = True
unique_together = (('name','date_created'),)
ordering = ['name','date_created']

def natural_key(self):
return (self.name, self.date_created)

def __unicode__(self):
return self.name


TEMPLATE_TYPES = (
('HTML', 'HTML Text Template'),
('XML', 'XML Template'),
('TXT',  'Text Template'),
)

class Template(Base):
extends   = models.ManyToManyField('self', blank = True, null =True, 
related_name = 'extends_template', symmetrical = False)
includes   = models.ManyToManyField('self', blank = True, null =True, 
related_name = 'includes_template', symmetrical = False)
type   = models.CharField(max_length = 6, choices=TEMPLATE_TYPES)

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Yck43Fc-zpoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django lucene

2013-01-17 Thread Barun Saha
Puneet,

Were you able to solve this problem? I have been searching a solution for 
this almost the entire day!

On Monday, 31 August 2009 22:12:44 UTC+5:30, Puneet wrote:
>
> Hi, 
>
> Can anyone help with this in django with lucene? Is there anyone able 
> to use this module sucessfully. I am getting this error when I am 
> trying to search : 
>
> Error : 'Manager' object has no attribute 'objects_search' 
>
> Thanks, 
> Puneet 
> On Aug 25, 7:55 pm, Puneet  wrote: 
> > Hi, 
> > 
> > Does anyone have tried django-lucenemodule for search ?? 
> > 
> > I am able to compile theluceneand jcc as  required but the module is 
> > not working properly as it is expected to work.  As mentioned in the 
> > docs I have added to fields in my model 
> > 
> >objects = models.Manager() 
> >objects_search = Manager() # add search manager 
> > 
> > But when I say ModelName.save() its not getting indexed withlucene 
> > and when I say 
> > 
> >  ModelName.objects.objects_search(name_first="Spike") 
> > 
> > I am getting error that 
> > 
> > AttributeError: 'Manager' object has no attribute 'objects_search' 
> > 
> > Can any one help me with this ?? Does anyone have a small working 
> > example ? 
> > 
> > Thanks, 
> > Puneet

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/13ITksv0GuUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help - how to deploy to nginx in windows

2013-01-17 Thread frocco
Hello,

If I create a base django app, how can I get it to run using nginx in 
windows?
I keep getting 404 errors.

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eeQT6VYHS8EJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



list of dicts to Table2

2013-01-17 Thread Andy Woods
Afraid I just cannot figure out your help file on 'populating a table with 
data' with non-queryset data.  I am quite the Newbie so apologies in 
advance for yet another non-issue.  Would you mind providing a more fleshed 
out example for your helpfile?  Hope you don't mind.

I started a stackoverflow question on 
this.
 
 Spent the whole day trying to figure this out :(

Thanks, Andy.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/EqmgSOc_rXoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Table2 populated by raw SQL query, help needed

2013-01-17 Thread Andy Woods
Hi,
I need to use a raw SQL query and populate a table2 table with the results.
The query works fine and returns a list of Dicts using this function from 
the helpfile :

def dictfetchall(cursor):
"Returns all rows from a cursor as a dict"
desc = cursor.description
return [
dict(zip([col[0] for col in desc], row))
for row in cursor.fetchall()
]

My issue is that I cannot figure out how to populate a Table2 table with 
this info.  Table2 suggests 
this a way to achieve my goal, but I can't figure it out. 

import django_tables2 as tables
data = [
{"name": "Bradley"},
{"name": "Stevie"},]
class NameTable(tables.Table):
name = tables.Column()
table = NameTable(data)


Your help would be much appreciated.  Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/q9Q9X1JtjZwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: static files, runserver debug=True

2013-01-17 Thread Tom Evans
On Wed, Jan 16, 2013 at 11:31 PM, Fred Kingham  wrote:
> perfect thanks Javier.
>
> I guess my question should have been phrased, if debug = False, does the
> runserver serve static files  from the STATIC_ROOT. Clearly that's no.
>
> Thanks again.
>
>  Fred

Even with debug=True, runserver does not serve files from STATIC_ROOT,
it dynamically locates them inside your python packages on each
request. This is more expensive, but means you do not need to
constantly keep running collectstatic during development.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.