Re: How can I create a sequence number for a data set in the model?

2012-04-07 Thread Abhaya Agarwal
Hi Mark,

On Sat, Apr 7, 2012 at 8:57 PM, Mark Phillips wrote:

> Actually, just an ORDER BY FK, PK would produce the above... GROUP
>> BY would be used if you need something like counts/avg for each FK set.
>>
>
> I agree that if the data in the db was entered correctly in the first
> place, then just ORDER BY on the FK and PK would be sufficient. However, if
> the user needs to insert some data between sequence #3 and sequence #4,
> then I have to muck with the primary key of the table, which sounds
> dangerous.
>

I also have a similar problem in a project right now and have thought of 2
possible solutions. First is to use a FloatField or a DecimalField (o). Do
not reset it on every FK change. If the user wants to insert something
between records a & b, assign it a o value which is average of a.o and b.o.
If you are not expecting too many such insertions, it should work fine.

The other option is to store the ordering explicitly in the Foreign Key
model using a JSONField. This means that you will have to move all the work
involving ordering in the python layer which may or may not be suitable for
your case.

Currently I am going with option 2 for my case.

Regards,
Abhaya

-- 
-
blog: http://abhaga.blogspot.com
Twitter: http://twitter.com/abhaga
-

-- 
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: Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-07 Thread Russell Keith-Magee
Hi,

What you've hit here is the end of the deprecation cycle for code that doesn't 
support multiple databases.

In Django 1.2, we introduced multiple database support; in order to support 
this, the prototype for get_db_preb_lookup() and get_db_prep_value() was 
changed.

For backwards compatibility, we added a shim that would transparently 'fix' 
these methods if they hadn't already been fixed by the developer.

In Django 1.2, the usage of these shims raised a PendingDeprecationWarning. In 
Django 1.3, they raised a DeprecationWarning.

Under Django 1.4, the shim code was been removed -- so any code that wasn't 
updated will now raise errors like the one you describe.

All the core Django fields should have been updated to use the new signature, 
so if you're seeing errors, it's probably because of a custom field that you're 
using that needs to be updated. As far as I can make out, Django's default 
ImageField shouldn't have this problem (it doesn't even have db_prep_* methods, 
because there's nothing database specific about the storage of FileFields).

If you can reproduce this on a project that only uses Django's built-in field 
types, then this is a bug in Django that needs to be addressed.

Yours
Russ Magee %-)


On Saturday, 7 April 2012 at 12:03 PM, xthepoet wrote:

> This was working fine for my Ubuntu 10.04LTE system with Django
> 1.3.1. It seems broken now in 1.4.
> 
> In Django 1.4, I get this error TypeError: get_db_prep_value() got an
> unexpected keyword argument 'connection' when saving an image to an
> ImageField.
> 
> System (installed from Ubuntu Lucid repository packages):
> Django 1.4
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> 
> The model field is defined as: origin_image =
> models.ImageField(upload_to='images/origin')
> The offending call is: obj.origin_image.save(fbFileName,
> ContentFile(input_file.getvalue()))
> 
> Traceback (most recent call last):
> File "/home/seeker/src/ceeq/seekerapp/management/commands/
> addUser.py", line 100, in addPhotos
> obj.origin_image.save(fbFileName,
> ContentFile(input_file.getvalue()))
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/fields/files.py", line 95, in save
> self.instance.save()
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/base.py", line 463, in save
> self.save_base(using=using, force_insert=force_insert,
> force_update=force_update)
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/base.py", line 551, in save_base
> result = manager._insert([self], fields=fields,
> return_id=update_pk, using=using, raw=raw)
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/manager.py", line 203, in _insert
> return insert_query(self.model, objs, fields, **kwargs)
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/query.py", line 1576, in insert_query
> return query.get_compiler(using=using).execute_sql(return_id)
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/sql/compiler.py", line 909, in execute_sql
> for sql, params in self.as_sql():
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/sql/compiler.py", line 872, in as_sql
> for obj in self.query.objs
> File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> django/db/models/fields/__init__.py", line 292, in get_db_prep_save
> prepared=False)
> TypeError: get_db_prep_value() got an unexpected keyword argument
> 'connection'
> 
> This problem was also reported on the django-celery board:
> https://github.com/ask/celery/issues/624
> But I've realized that for me, it's not a celery issue.
> 
> -- 
> 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 
> (mailto:django-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com 
> (mailto: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.



loader.select_template breaks template name

2012-04-07 Thread gnesher
Hi,

I'm receiving some odd results while playing with select_template
(Django 1.4)

I'm calling the following code in my view:
loader.select_template('test.html')

Which results in the following error:

TemplateDoesNotExist at /test
t, e, s, ., h, m, l

Can't really figure out what I'm doing wrong as this should be rather
straightforward.

Thanks

-- 
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: Upgrading django on a mac

2012-04-07 Thread Jonathan Baker
Ah, good to know. Apologies, but I glanced over your original code to
quickly and thought you renamed the directory. Glad it worked out.

On Sat, Apr 7, 2012 at 3:54 PM, Larry Martell wrote:

> On Sat, Apr 7, 2012 at 3:46 PM, Jonathan Baker
>  wrote:
> > I'm guessing that your $PATH is configured to look for django in it's old
> > location, and not the new one.
>
> No it's not that (the new location is the same as the old). But I
> figured it out - the django python package is apparently a
> subdirectory of the git repository. I did this:
>
> mv django django.git
> ln -s django.git/django django
>
> And now it's finding it.
>
>
> >
> > On Sat, Apr 7, 2012 at 3:33 PM, Larry Martell 
> > wrote:
> >>
> >> I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I was running
> >> django -r 13034 that I got from SVN. I am trying to upgrade to 1.4
> >> from git. After I upgrade, python can no longer find django. Here's
> >> what I did:
> >>
> >> $ cd /usr/local/lib/python2.6/dist-packages
> >> $ sudo mv django/ django-13034
> >> $ sudo git clone https://github.com/django/django.git django
> >> $ python
> >> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> >> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> >> Type "help", "copyright", "credits" or "license" for more information.
> >> >>> import django
> >> Traceback (most recent call last):
> >>  File "", line 1, in 
> >> ImportError: No module named django
> >>
> >> If I switch back:
> >>
> >> $ sudo mv django django1.4
> >> $ sudo mv django-13034/ django
> >>
> >> It again finds it:
> >>
> >> $ python
> >> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> >> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> >> Type "help", "copyright", "credits" or "license" for more information.
> >> >>> import django
> >> >>> ^D
> >>
> >> Anyone know what's wrong?
> >>
> >> --
> >> 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.
> >>
> >
> >
> >
> > --
> > Jonathan D. Baker
> > Web Developer
> > http://jonathandbaker.com
> > 303.257.4144
> >
> > --
> > 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.
>
> --
> 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.
>
>


-- 
Jonathan D. Baker
Web Developer
http://jonathandbaker.com
303.257.4144

-- 
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: Upgrading django on a mac

2012-04-07 Thread Larry Martell
On Sat, Apr 7, 2012 at 3:46 PM, Jonathan Baker
 wrote:
> I'm guessing that your $PATH is configured to look for django in it's old
> location, and not the new one.

No it's not that (the new location is the same as the old). But I
figured it out - the django python package is apparently a
subdirectory of the git repository. I did this:

mv django django.git
ln -s django.git/django django

And now it's finding it.


>
> On Sat, Apr 7, 2012 at 3:33 PM, Larry Martell 
> wrote:
>>
>> I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I was running
>> django -r 13034 that I got from SVN. I am trying to upgrade to 1.4
>> from git. After I upgrade, python can no longer find django. Here's
>> what I did:
>>
>> $ cd /usr/local/lib/python2.6/dist-packages
>> $ sudo mv django/ django-13034
>> $ sudo git clone https://github.com/django/django.git django
>> $ python
>> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
>> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import django
>> Traceback (most recent call last):
>>  File "", line 1, in 
>> ImportError: No module named django
>>
>> If I switch back:
>>
>> $ sudo mv django django1.4
>> $ sudo mv django-13034/ django
>>
>> It again finds it:
>>
>> $ python
>> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
>> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import django
>> >>> ^D
>>
>> Anyone know what's wrong?
>>
>> --
>> 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.
>>
>
>
>
> --
> Jonathan D. Baker
> Web Developer
> http://jonathandbaker.com
> 303.257.4144
>
> --
> 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.

-- 
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: Upgrading django on a mac

2012-04-07 Thread Jonathan Baker
I'm guessing that your $PATH is configured to look for django in it's old
location, and not the new one.

On Sat, Apr 7, 2012 at 3:33 PM, Larry Martell wrote:

> I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I was running
> django -r 13034 that I got from SVN. I am trying to upgrade to 1.4
> from git. After I upgrade, python can no longer find django. Here's
> what I did:
>
> $ cd /usr/local/lib/python2.6/dist-packages
> $ sudo mv django/ django-13034
> $ sudo git clone https://github.com/django/django.git django
> $ python
> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> Traceback (most recent call last):
>  File "", line 1, in 
> ImportError: No module named django
>
> If I switch back:
>
> $ sudo mv django django1.4
> $ sudo mv django-13034/ django
>
> It again finds it:
>
> $ python
> Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> >>> ^D
>
> Anyone know what's wrong?
>
> --
> 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.
>
>


-- 
Jonathan D. Baker
Web Developer
http://jonathandbaker.com
303.257.4144

-- 
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.



Upgrading django on a mac

2012-04-07 Thread Larry Martell
I'm on a mac, running Mac OS X Version 10.5.8 (Leopard). I was running
django -r 13034 that I got from SVN. I am trying to upgrade to 1.4
from git. After I upgrade, python can no longer find django. Here's
what I did:

$ cd /usr/local/lib/python2.6/dist-packages
$ sudo mv django/ django-13034
$ sudo git clone https://github.com/django/django.git django
$ python
Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django

If I switch back:

$ sudo mv django django1.4
$ sudo mv django-13034/ django

It again finds it:

$ python
Python 2.6.7 (r267:88850, Jan 11 2012, 06:42:34)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> ^D

Anyone know what's wrong?

-- 
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: PostGIS 2.0.0 problems

2012-04-07 Thread Christophe Pettus

On Apr 7, 2012, at 12:01 PM, Oleg Korsak wrote:

> sorry? which one SQL? :) I'm trying to run tests with Jenkins CI, but
> it fails on creating DB.

Ah, OK.  The automated tests will probably fail, yes.  For your application, 
you can work around this problem by manually created the indexes rather than 
letting Django do it.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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: PostGIS 2.0.0 problems

2012-04-07 Thread Oleg Korsak
sorry? which one SQL? :) I'm trying to run tests with Jenkins CI, but
it fails on creating DB.


7 апреля 2012 г. 21:56 пользователь Christophe Pettus
 написал:
>
> On Apr 7, 2012, at 11:41 AM, Oleg Korsak wrote:
>
>> So looks PostGIS 2.0.0 is unusable with Django right now?
>
> There's no reason you can't apply the SQL manually for the moment.
> --
> -- Christophe Pettus
>   x...@thebuild.com
>
> --
> 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.
>

-- 
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: PostGIS 2.0.0 problems

2012-04-07 Thread Christophe Pettus

On Apr 7, 2012, at 11:41 AM, Oleg Korsak wrote:

> So looks PostGIS 2.0.0 is unusable with Django right now?

There's no reason you can't apply the SQL manually for the moment.
--
-- Christophe Pettus
   x...@thebuild.com

-- 
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.



PostGIS 2.0.0 problems

2012-04-07 Thread Oleg Korsak
Hello. After upgrading PostGIS to 2.0.0 version and migrating DB (took
some time) I still have one problem:

django.db.utils.DatabaseError: operator class "gist_geometry_ops" does
not exist for access method "gist"

I've found a discussion here: https://code.djangoproject.com/ticket/16455
So looks PostGIS 2.0.0 is unusable with Django right now?

-- 
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.



Reloading a project without restarting Python

2012-04-07 Thread Tobia Conforto
Hi all

I'm developing a portlet bridge in Jython, to enable developing J2EE
portlets in Django, and I need to include a reload-on-code-change
feature, to aid in development.

Unfortunately, the way django.utils.autoreload works, by triggering a
complete restart of the Jython interpreter, has huge memory and thread
leaks in Jython.  It would appear that there is no clean way to unload
a
Jython interpreter from the JVM once it's been started.  (For backing
of
this assertion, see my latest post on the jython-users list.)

Therefore I'd like to know if there is a way to reload a Django
project
from within Python, without restarting the interpreter itself.

For normal development it would be enough to reload the project's own
models, views, urls, admin, form, middleware and such classes.  Some
of
the settings could be kept, if it made the reloading simpler, such as
filesystem paths, database connections, installed apps and middleware.

Any changes to the standard library, Django, and in general any code
that is not part of the current project's module could be ignored. If
a developer needs to reload that, he can very well restart everything!

Does anybody have any advice on how to do this?

-Tobia

-- 
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: How can I access log production server?

2012-04-07 Thread Arruda
Thanks for clarifying me that Ejah, but I already have it configured(got 
from a friend project).
But after reading the docs for it, I still can't understand how to do it 
look like the runserver command.
Could you give me some example, please?
Thanks

Em sábado, 7 de abril de 2012 03h36min44s UTC-3, Ejah escreveu:
>
> You can set your logging params at the bottom of your settings.py 
> file. Here you can determine when, how and where django will log. 
> Hth 
>
> On 7 apr, 00:04, Arruda  wrote: 
> > Hi there, I'm using nginx and fastcgi(using threaded method) to run a 
> > django project, but when another thread start I get some erros. 
> > But I don't know if this is a thread problem or a db problem or what... 
> > But wanted to know if there is someway to get log from the production 
> > server. 
> > When I use runserver I get to see the log in the console, but in 
> production 
> > where do I get all that info? like exceptions, requests and other stuff? 
> > Do I need to configure the logging api? but how? I'm ok(even better) to 
> see 
> > the log in the console, is there a way? 
> > 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/-/axi96eZpQbEJ.
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
the problem is solved.

Just saving the view file under vim solved it.

It must have been an encoding problems with the file.

But it was strange because it reads some part of the file.

By the way thanks for your support.

Bussiere

Le samedi 7 avril 2012 18:13:28 UTC+2, Marcin a écrit :
>
> I'm not sure what you think we can do to help you with this information.
>
> On Sat, Apr 7, 2012 at 17:06, Bussiere  wrote:
>
>> my point the import in shell does not work too.
>>
>> I had a import error from a line of import in view corrected it and it's 
>> still not working.
>>
>> i had an error in a form imported.
>>
>> So it reads the file because he tel me if there is an error but it didn't 
>> found index.
>>
>> Regards
>>
>>
>> Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>>
>>> So, you can import the function in the django shell? Have you considered 
>>> replacing the string-based import with a normal import?
>>>
>>>
>>> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>>>
 Everything is fine.

 I said you it worked five second before ...


  Bussiere

 Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :

> Reinstalling django will not help. Verify that the file is present and 
> has the correct permissions (likewise all superior directories, and also 
> the relevant __init__.py files. These files are essential.). 
>
> You may also like to run the django shell, and try to import that 
> module. If that does not work, examine the sys.path setting to ensure 
> that 
> jackpoint is on the path. 
>
> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>
>> i've made no deploiement at all ...
>>
>> No views in invitation works.
>>
>>
>>  I was working on live with the test server runnning.
>>
>> (i've tried to restart it more than one time after i get this error).
>>
>> And by magic all the views in invitation don't works, they are not 
>> found.
>>
>> Maybe a reinstallation of django ?
>>
>> Have you any suggestion ?
>>
>> Bussiere
>>
>>
>>
>> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>>
>>> Does  invitation/create_invitation **work? If not, I suspect 
>>> that you have either some kind of configuration issue, or the file has 
>>> gone 
>>> missing from your deployment/has wrong permissions set.
>>>
>>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>>
 from django.conf.urls.defaults import patterns, include, url

 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 admin.autodiscover()

 urlpatterns = patterns('',
 # Examples:
 # url(r'^$', 'Jackpoint.views.home', name='home'),
 # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
 url(r'^$', 'jackpoint.engine.views.index'**),
 #url(r'^X/$', 'jackpoint.X.views.index'),
 url(r'^invitation/$', 'jackpoint.invitation.views.**in
 dex'),
 # Uncomment the admin/doc line below to enable admin 
 documentation:
 url(r'^admin/doc/', include('django.contrib.**admind
 ocs.urls')),
 
 url(r'^invitation/create_**invitation/$', 
 'jackpoint.invitation.views.**create_invitation'),
 url(r'^invitation/inscription/**$', 
 'jackpoint.invitation.views.**invitation_inscription'),
 url(r'^hand/$', 'jackpoint.hand.views.index'),
 url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
 # Uncomment the next line to enable the admin:
 url(r'^admin/', include(admin.site.urls)),
 )


 Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :

> What does your urls.py look like?
>
> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>
>> i've got this error :
>> ViewDoesNotExist at /invitation/ 
>>
>> Could not import jackpoint.invitation.views.**ind**ex. View does 
>> not exist in module jackpoint.invitation.views.
>>
>>
>> But yes it exist and worked fine 5 secondes before.
>>
>>
>>  the image of eclipse :
>>
>> http://dl.dropbox.com/u/**197533**32/wtf.png 
>>   
>>
>>
>> all the other view works well.
>>
>>
>>
>> And when i close and reopen firefox, all the views works fine and 
>> that one appaeras 5 secondes freeze then say it doesn't exist.
>>
>>
>> the view is here :
>>
>> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>>  
>> 

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
I'm not sure what you think we can do to help you with this information.

On Sat, Apr 7, 2012 at 17:06, Bussiere  wrote:

> my point the import in shell does not work too.
>
> I had a import error from a line of import in view corrected it and it's
> still not working.
>
> i had an error in a form imported.
>
> So it reads the file because he tel me if there is an error but it didn't
> found index.
>
> Regards
>
>
> Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>
>> So, you can import the function in the django shell? Have you considered
>> replacing the string-based import with a normal import?
>>
>>
>> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>>
>>> Everything is fine.
>>>
>>> I said you it worked five second before ...
>>>
>>>
>>> Bussiere
>>>
>>> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>>>
 Reinstalling django will not help. Verify that the file is present and
 has the correct permissions (likewise all superior directories, and also
 the relevant __init__.py files. These files are essential.).

 You may also like to run the django shell, and try to import that
 module. If that does not work, examine the sys.path setting to ensure that
 jackpoint is on the path.

 On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:

> i've made no deploiement at all ...
>
> No views in invitation works.
>
>
>  I was working on live with the test server runnning.
>
> (i've tried to restart it more than one time after i get this error).
>
> And by magic all the views in invitation don't works, they are not
> found.
>
> Maybe a reinstallation of django ?
>
> Have you any suggestion ?
>
> Bussiere
>
>
>
> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>
>> Does  invitation/create_invitation **work? If not, I suspect
>> that you have either some kind of configuration issue, or the file has 
>> gone
>> missing from your deployment/has wrong permissions set.
>>
>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>
>>> from django.conf.urls.defaults import patterns, include, url
>>>
>>> # Uncomment the next two lines to enable the admin:
>>> from django.contrib import admin
>>> admin.autodiscover()
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
>>> url(r'^$', 'jackpoint.engine.views.index'**),
>>> #url(r'^X/$', 'jackpoint.X.views.index'),
>>> url(r'^invitation/$', 'jackpoint.invitation.views.**index'),
>>> # Uncomment the admin/doc line below to enable admin
>>> documentation:
>>> url(r'^admin/doc/', include('django.contrib.**admind
>>> ocs.urls')),
>>>
>>> url(r'^invitation/create_**invitation/$',
>>> 'jackpoint.invitation.views.**create_invitation'),
>>> url(r'^invitation/inscription/**$',
>>> 'jackpoint.invitation.views.**invitation_inscription'),
>>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>>> # Uncomment the next line to enable the admin:
>>> url(r'^admin/', include(admin.site.urls)),
>>> )
>>>
>>>
>>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>>
 What does your urls.py look like?

 On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:

> i've got this error :
> ViewDoesNotExist at /invitation/
>
> Could not import jackpoint.invitation.views.**ind**ex. View does 
> not exist in module jackpoint.invitation.views.
>
>
> But yes it exist and worked fine 5 secondes before.
>
>
>  the image of eclipse :
>
> http://dl.dropbox.com/u/**197533**32/wtf.png 
> 
>
>
> all the other view works well.
>
>
>
> And when i close and reopen firefox, all the views works fine and 
> that one appaeras 5 secondes freeze then say it doesn't exist.
>
>
> the view is here :
>
> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>  
> 
>   **
>
>
> regards
>
> bussiere
>
>
>
>  --
> 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/**ms**g/django-users/-/**
> kiSWlzDrl2

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
FINNND

\o/


Save the file under vim resolved the problems >.>


Bussiere


Le samedi 7 avril 2012 18:06:32 UTC+2, Bussiere a écrit :
>
> my point the import in shell does not work too.
>
> I had a import error from a line of import in view corrected it and it's 
> still not working.
>
> i had an error in a form imported.
>
> So it reads the file because he tel me if there is an error but it didn't 
> found index.
>
> Regards
>
>
> Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>>
>> So, you can import the function in the django shell? Have you considered 
>> replacing the string-based import with a normal import?
>>
>> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>>
>>> Everything is fine.
>>>
>>> I said you it worked five second before ...
>>>
>>>
>>> Bussiere
>>>
>>> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>>>
 Reinstalling django will not help. Verify that the file is present and 
 has the correct permissions (likewise all superior directories, and also 
 the relevant __init__.py files. These files are essential.). 

 You may also like to run the django shell, and try to import that 
 module. If that does not work, examine the sys.path setting to ensure that 
 jackpoint is on the path. 

 On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:

> i've made no deploiement at all ...
>
> No views in invitation works.
>
>
>  I was working on live with the test server runnning.
>
> (i've tried to restart it more than one time after i get this error).
>
> And by magic all the views in invitation don't works, they are not 
> found.
>
> Maybe a reinstallation of django ?
>
> Have you any suggestion ?
>
> Bussiere
>
>
>
> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>
>> Does  invitation/create_invitation **w**ork? If not, I suspect that 
>> you have either some kind of configuration issue, or the file has gone 
>> missing from your deployment/has wrong permissions set.
>>
>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>
>>> from django.conf.urls.defaults import patterns, include, url
>>>
>>> # Uncomment the next two lines to enable the admin:
>>> from django.contrib import admin
>>> admin.autodiscover()
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
>>> url(r'^$', 'jackpoint.engine.views.index'),
>>> #url(r'^X/$', 'jackpoint.X.views.index'),
>>> url(r'^invitation/$', 'jackpoint.invitation.views.**in**dex'),
>>> # Uncomment the admin/doc line below to enable admin 
>>> documentation:
>>> url(r'^admin/doc/', include('django.contrib.**admind**
>>> ocs.urls')),
>>> 
>>> url(r'^invitation/create_**invit**ation/$', 
>>> 'jackpoint.invitation.views.**cr**eate_invitation'),
>>> url(r'^invitation/inscription/$', 
>>> 'jackpoint.invitation.views.**in**vitation_inscription'),
>>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>>> # Uncomment the next line to enable the admin:
>>> url(r'^admin/', include(admin.site.urls)),
>>> )
>>>
>>>
>>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>>
 What does your urls.py look like?

 On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:

> i've got this error :
> ViewDoesNotExist at /invitation/ 
>
> Could not import jackpoint.invitation.views.**index. View does 
> not exist in module jackpoint.invitation.views.
>
>
> But yes it exist and worked fine 5 secondes before.
>
>
>  the image of eclipse :
>
> http://dl.dropbox.com/u/**19753332/wtf.png 
>   
>
>
> all the other view works well.
>
>
>
> And when i close and reopen firefox, all the views works fine and 
> that one appaeras 5 secondes freeze then say it doesn't exist.
>
>
> the view is here :
>
> https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
>  
> 
>  ** ** 
>
>
> regards
>
> bussiere
>
>
>
>  -- 
> You received this message because you are subscribed to the Google 
> Groups "Django users" group.

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
and i've used cygwin vim to find if there was some bad characters in the 
file but no.


Bussiere

Le samedi 7 avril 2012 18:03:17 UTC+2, Marcin a écrit :
>
> python manage.py shell
>
> On Sat, Apr 7, 2012 at 16:59, Bussiere  wrote:
>
>> how to do that ?
>>
>> Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>>
>>> So, you can import the function in the django shell? Have you considered 
>>> replacing the string-based import with a normal import?
>>>
>>> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>>>
 Everything is fine.

 I said you it worked five second before ...


  Bussiere

 Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :

> Reinstalling django will not help. Verify that the file is present and 
> has the correct permissions (likewise all superior directories, and also 
> the relevant __init__.py files. These files are essential.). 
>
> You may also like to run the django shell, and try to import that 
> module. If that does not work, examine the sys.path setting to ensure 
> that 
> jackpoint is on the path. 
>
> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>
>> i've made no deploiement at all ...
>>
>> No views in invitation works.
>>
>>
>>  I was working on live with the test server runnning.
>>
>> (i've tried to restart it more than one time after i get this error).
>>
>> And by magic all the views in invitation don't works, they are not 
>> found.
>>
>> Maybe a reinstallation of django ?
>>
>> Have you any suggestion ?
>>
>> Bussiere
>>
>>
>>
>> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>>
>>> Does  invitation/create_invitation **work? If not, I suspect 
>>> that you have either some kind of configuration issue, or the file has 
>>> gone 
>>> missing from your deployment/has wrong permissions set.
>>>
>>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>>
 from django.conf.urls.defaults import patterns, include, url

 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 admin.autodiscover()

 urlpatterns = patterns('',
 # Examples:
 # url(r'^$', 'Jackpoint.views.home', name='home'),
 # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
 url(r'^$', 'jackpoint.engine.views.index'**),
 #url(r'^X/$', 'jackpoint.X.views.index'),
 url(r'^invitation/$', 'jackpoint.invitation.views.**in
 dex'),
 # Uncomment the admin/doc line below to enable admin 
 documentation:
 url(r'^admin/doc/', include('django.contrib.**admind
 ocs.urls')),
 
 url(r'^invitation/create_**invitation/$', 
 'jackpoint.invitation.views.**create_invitation'),
 url(r'^invitation/inscription/**$', 
 'jackpoint.invitation.views.**invitation_inscription'),
 url(r'^hand/$', 'jackpoint.hand.views.index'),
 url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
 # Uncomment the next line to enable the admin:
 url(r'^admin/', include(admin.site.urls)),
 )


 Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :

> What does your urls.py look like?
>
> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>
>> i've got this error :
>> ViewDoesNotExist at /invitation/ 
>>
>> Could not import jackpoint.invitation.views.**ind**ex. View does 
>> not exist in module jackpoint.invitation.views.
>>
>>
>> But yes it exist and worked fine 5 secondes before.
>>
>>
>>  the image of eclipse :
>>
>> http://dl.dropbox.com/u/**197533**32/wtf.png 
>>   
>>
>>
>> all the other view works well.
>>
>>
>>
>> And when i close and reopen firefox, all the views works fine and 
>> that one appaeras 5 secondes freeze then say it doesn't exist.
>>
>>
>> the view is here :
>>
>> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>>  
>> 
>>   ** 
>>
>>
>> regards
>>
>> bussiere
>>
>>
>>
>>  -- 
>> 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/**ms**g/django-users/-/**
>>>

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
my point the import in shell does not work too.

I had a import error from a line of import in view corrected it and it's 
still not working.

i had an error in a form imported.

So it reads the file because he tel me if there is an error but it didn't 
found index.

Regards


Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>
> So, you can import the function in the django shell? Have you considered 
> replacing the string-based import with a normal import?
>
> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>
>> Everything is fine.
>>
>> I said you it worked five second before ...
>>
>>
>> Bussiere
>>
>> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>>
>>> Reinstalling django will not help. Verify that the file is present and 
>>> has the correct permissions (likewise all superior directories, and also 
>>> the relevant __init__.py files. These files are essential.). 
>>>
>>> You may also like to run the django shell, and try to import that 
>>> module. If that does not work, examine the sys.path setting to ensure that 
>>> jackpoint is on the path. 
>>>
>>> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>>>
 i've made no deploiement at all ...

 No views in invitation works.


  I was working on live with the test server runnning.

 (i've tried to restart it more than one time after i get this error).

 And by magic all the views in invitation don't works, they are not 
 found.

 Maybe a reinstallation of django ?

 Have you any suggestion ?

 Bussiere



 Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :

> Does  invitation/create_invitation **w**ork? If not, I suspect that 
> you have either some kind of configuration issue, or the file has gone 
> missing from your deployment/has wrong permissions set.
>
> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>
>> from django.conf.urls.defaults import patterns, include, url
>>
>> # Uncomment the next two lines to enable the admin:
>> from django.contrib import admin
>> admin.autodiscover()
>>
>> urlpatterns = patterns('',
>> # Examples:
>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
>> url(r'^$', 'jackpoint.engine.views.index'),
>> #url(r'^X/$', 'jackpoint.X.views.index'),
>> url(r'^invitation/$', 'jackpoint.invitation.views.**in**dex'),
>> # Uncomment the admin/doc line below to enable admin 
>> documentation:
>> url(r'^admin/doc/', include('django.contrib.**admind**
>> ocs.urls')),
>> 
>> url(r'^invitation/create_**invit**ation/$', 
>> 'jackpoint.invitation.views.**cr**eate_invitation'),
>> url(r'^invitation/inscription/$', 
>> 'jackpoint.invitation.views.**in**vitation_inscription'),
>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>> # Uncomment the next line to enable the admin:
>> url(r'^admin/', include(admin.site.urls)),
>> )
>>
>>
>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>
>>> What does your urls.py look like?
>>>
>>> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>>>
 i've got this error :
 ViewDoesNotExist at /invitation/ 

 Could not import jackpoint.invitation.views.**index. View does not 
 exist in module jackpoint.invitation.views.


 But yes it exist and worked fine 5 secondes before.


  the image of eclipse :

 http://dl.dropbox.com/u/**19753332/wtf.png 
   


 all the other view works well.



 And when i close and reopen firefox, all the views works fine and that 
 one appaeras 5 secondes freeze then say it doesn't exist.


 the view is here :

 https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
  
 
  ** ** 


 regards

 bussiere



  -- 
 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/-/**kiSWlzDrl28J
 .
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 django-users+unsubscribe@**googlegroups.com
 .
 For more optio

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
python manage.py shell

On Sat, Apr 7, 2012 at 16:59, Bussiere  wrote:

> how to do that ?
>
> Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>
>> So, you can import the function in the django shell? Have you considered
>> replacing the string-based import with a normal import?
>>
>> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>>
>>> Everything is fine.
>>>
>>> I said you it worked five second before ...
>>>
>>>
>>> Bussiere
>>>
>>> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>>>
 Reinstalling django will not help. Verify that the file is present and
 has the correct permissions (likewise all superior directories, and also
 the relevant __init__.py files. These files are essential.).

 You may also like to run the django shell, and try to import that
 module. If that does not work, examine the sys.path setting to ensure that
 jackpoint is on the path.

 On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:

> i've made no deploiement at all ...
>
> No views in invitation works.
>
>
>  I was working on live with the test server runnning.
>
> (i've tried to restart it more than one time after i get this error).
>
> And by magic all the views in invitation don't works, they are not
> found.
>
> Maybe a reinstallation of django ?
>
> Have you any suggestion ?
>
> Bussiere
>
>
>
> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>
>> Does  invitation/create_invitation **work? If not, I suspect
>> that you have either some kind of configuration issue, or the file has 
>> gone
>> missing from your deployment/has wrong permissions set.
>>
>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>
>>> from django.conf.urls.defaults import patterns, include, url
>>>
>>> # Uncomment the next two lines to enable the admin:
>>> from django.contrib import admin
>>> admin.autodiscover()
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
>>> url(r'^$', 'jackpoint.engine.views.index'**),
>>> #url(r'^X/$', 'jackpoint.X.views.index'),
>>> url(r'^invitation/$', 'jackpoint.invitation.views.**index'),
>>> # Uncomment the admin/doc line below to enable admin
>>> documentation:
>>> url(r'^admin/doc/', include('django.contrib.**admind
>>> ocs.urls')),
>>>
>>> url(r'^invitation/create_**invitation/$',
>>> 'jackpoint.invitation.views.**create_invitation'),
>>> url(r'^invitation/inscription/**$',
>>> 'jackpoint.invitation.views.**invitation_inscription'),
>>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>>> # Uncomment the next line to enable the admin:
>>> url(r'^admin/', include(admin.site.urls)),
>>> )
>>>
>>>
>>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>>
 What does your urls.py look like?

 On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:

> i've got this error :
> ViewDoesNotExist at /invitation/
>
> Could not import jackpoint.invitation.views.**ind**ex. View does 
> not exist in module jackpoint.invitation.views.
>
>
> But yes it exist and worked fine 5 secondes before.
>
>
>  the image of eclipse :
>
> http://dl.dropbox.com/u/**197533**32/wtf.png 
> 
>
>
> all the other view works well.
>
>
>
> And when i close and reopen firefox, all the views works fine and 
> that one appaeras 5 secondes freeze then say it doesn't exist.
>
>
> the view is here :
>
> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>  
> 
>   **
>
>
> regards
>
> bussiere
>
>
>
>  --
> 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/**ms**g/django-users/-/**
> kiSWlzDrl28J
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> To unsubscribe from this group, send email to
> django-users+unsubscribe@**googl**egroups.com
> .
> For more options, visit t

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
how to do that ?

Le samedi 7 avril 2012 17:38:49 UTC+2, Marcin a écrit :
>
> So, you can import the function in the django shell? Have you considered 
> replacing the string-based import with a normal import?
>
> On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:
>
>> Everything is fine.
>>
>> I said you it worked five second before ...
>>
>>
>> Bussiere
>>
>> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>>
>>> Reinstalling django will not help. Verify that the file is present and 
>>> has the correct permissions (likewise all superior directories, and also 
>>> the relevant __init__.py files. These files are essential.). 
>>>
>>> You may also like to run the django shell, and try to import that 
>>> module. If that does not work, examine the sys.path setting to ensure that 
>>> jackpoint is on the path. 
>>>
>>> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>>>
 i've made no deploiement at all ...

 No views in invitation works.


  I was working on live with the test server runnning.

 (i've tried to restart it more than one time after i get this error).

 And by magic all the views in invitation don't works, they are not 
 found.

 Maybe a reinstallation of django ?

 Have you any suggestion ?

 Bussiere



 Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :

> Does  invitation/create_invitation **w**ork? If not, I suspect that 
> you have either some kind of configuration issue, or the file has gone 
> missing from your deployment/has wrong permissions set.
>
> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>
>> from django.conf.urls.defaults import patterns, include, url
>>
>> # Uncomment the next two lines to enable the admin:
>> from django.contrib import admin
>> admin.autodiscover()
>>
>> urlpatterns = patterns('',
>> # Examples:
>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
>> url(r'^$', 'jackpoint.engine.views.index'),
>> #url(r'^X/$', 'jackpoint.X.views.index'),
>> url(r'^invitation/$', 'jackpoint.invitation.views.**in**dex'),
>> # Uncomment the admin/doc line below to enable admin 
>> documentation:
>> url(r'^admin/doc/', include('django.contrib.**admind**
>> ocs.urls')),
>> 
>> url(r'^invitation/create_**invit**ation/$', 
>> 'jackpoint.invitation.views.**cr**eate_invitation'),
>> url(r'^invitation/inscription/$', 
>> 'jackpoint.invitation.views.**in**vitation_inscription'),
>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>> # Uncomment the next line to enable the admin:
>> url(r'^admin/', include(admin.site.urls)),
>> )
>>
>>
>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>
>>> What does your urls.py look like?
>>>
>>> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>>>
 i've got this error :
 ViewDoesNotExist at /invitation/ 

 Could not import jackpoint.invitation.views.**index. View does not 
 exist in module jackpoint.invitation.views.


 But yes it exist and worked fine 5 secondes before.


  the image of eclipse :

 http://dl.dropbox.com/u/**19753332/wtf.png 
   


 all the other view works well.



 And when i close and reopen firefox, all the views works fine and that 
 one appaeras 5 secondes freeze then say it doesn't exist.


 the view is here :

 https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
  
 
  ** ** 


 regards

 bussiere



  -- 
 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/-/**kiSWlzDrl28J
 .
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 django-users+unsubscribe@**googlegroups.com
 .
 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>
>>>
>>> -- 
>>> Marcin Tustin
>>> Tel: 07773 787 105
>>>
>>

Re: superclass SingleObjectMixin

2012-04-07 Thread Dave
Thanks Daniel, appreciate the super fast response! I did your
suggestion and it works like a charm. It's better than putting the
method in each class. Was just hoping there is a way I could override
get_object in the singeobjectmixin everywhere vs. adding another mixin
for each CBV. Perhaps i'm just being too lazy

Thanks again!

Dave


On Apr 7, 11:45 am, Daniel Roseman  wrote:
> On Saturday, 7 April 2012 16:40:05 UTC+1, Dave wrote:
>
> > Hi, I need to manipulate my pk when using new class based views. In
> > order to DRY I think what's needed is to superclass SingleObjectMixin.
>
> > I have the following but it's not working. Greatly appreciate help/
> > suggestions!
>
> > In view.py have the below which does not work.
>
> > from django.views.generic.detail import SingleObjectMixin
> > class SingleObjectMixin(SingleObjectMixin):
>
> >     def get_object(self, *args, **kwargs):
> >         queryset = self.get_queryset()
> >         pk = pid_to_oid(self.kwargs.get('pk'))
> >         queryset = queryset.filter(pk=pk)
> >         obj = queryset.get()
> >         return obj
>
> >         return super(SingleObjectMixin,self).get_object(self, *args,
> > **kwargs)
>
> > from django.views.generic import ListView, DetailView
>
> > but if I do the below it works(but prefer to not have to add this to
> > each CBV).
>
> > class ItemDetailView(DetailView):
> >     model=Item
>
> >     def get_object(self):
> >         queryset = self.get_queryset()
> >         pk = pid_to_oid(self.kwargs.get('pk'))
> >         queryset = queryset.filter(pk=pk)
> >         obj = queryset.get()
> >         return obj
>
> > Thanks in advance for the help.
>
> > Dave
>
> I'm not quite sure what you're trying to do here, especially in your use of
> "superclass" rather than the more normal "subclass". In any case, you can't
> simply subclass something but call your class the same name as the parent
> class and just expect all references to the superclass to be magically
> replaced by your class.
>
> The thing I guess you're missing is that SingleObjectMixin is, well, a
> mixin. So you can just mix it in to your view class:
>
>     class ItemDetailView(MySingleObjectMixin, DetailView):
>
> and according to Python's rules of inheritance, it will find your
> get_object method in place of the original one.
> --
> DR.

-- 
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: superclass SingleObjectMixin

2012-04-07 Thread Daniel Roseman
On Saturday, 7 April 2012 16:40:05 UTC+1, Dave wrote:
>
> Hi, I need to manipulate my pk when using new class based views. In 
> order to DRY I think what's needed is to superclass SingleObjectMixin. 
>
> I have the following but it's not working. Greatly appreciate help/ 
> suggestions! 
>
> In view.py have the below which does not work. 
>
> from django.views.generic.detail import SingleObjectMixin 
> class SingleObjectMixin(SingleObjectMixin): 
>
> def get_object(self, *args, **kwargs): 
> queryset = self.get_queryset() 
> pk = pid_to_oid(self.kwargs.get('pk')) 
> queryset = queryset.filter(pk=pk) 
> obj = queryset.get() 
> return obj 
>
> return super(SingleObjectMixin,self).get_object(self, *args, 
> **kwargs) 
>
> from django.views.generic import ListView, DetailView 
>
> but if I do the below it works(but prefer to not have to add this to 
> each CBV). 
>
> class ItemDetailView(DetailView): 
> model=Item 
>
> def get_object(self): 
> queryset = self.get_queryset() 
> pk = pid_to_oid(self.kwargs.get('pk')) 
> queryset = queryset.filter(pk=pk) 
> obj = queryset.get() 
> return obj 
>
> Thanks in advance for the help. 
>
> Dave 
>
>
>
I'm not quite sure what you're trying to do here, especially in your use of 
"superclass" rather than the more normal "subclass". In any case, you can't 
simply subclass something but call your class the same name as the parent 
class and just expect all references to the superclass to be magically 
replaced by your class.

The thing I guess you're missing is that SingleObjectMixin is, well, a 
mixin. So you can just mix it in to your view class:

class ItemDetailView(MySingleObjectMixin, DetailView): 

and according to Python's rules of inheritance, it will find your 
get_object method in place of the original one.
--
DR.

-- 
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/-/oQkXKxxp7EkJ.
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.



superclass SingleObjectMixin

2012-04-07 Thread Dave
Hi, I need to manipulate my pk when using new class based views. In
order to DRY I think what's needed is to superclass SingleObjectMixin.

I have the following but it's not working. Greatly appreciate help/
suggestions!

In view.py have the below which does not work.

from django.views.generic.detail import SingleObjectMixin
class SingleObjectMixin(SingleObjectMixin):

def get_object(self, *args, **kwargs):
queryset = self.get_queryset()
pk = pid_to_oid(self.kwargs.get('pk'))
queryset = queryset.filter(pk=pk)
obj = queryset.get()
return obj

return super(SingleObjectMixin,self).get_object(self, *args,
**kwargs)

from django.views.generic import ListView, DetailView

but if I do the below it works(but prefer to not have to add this to
each CBV).

class ItemDetailView(DetailView):
model=Item

def get_object(self):
queryset = self.get_queryset()
pk = pid_to_oid(self.kwargs.get('pk'))
queryset = queryset.filter(pk=pk)
obj = queryset.get()
return obj

Thanks in advance for the help.

Dave






-- 
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
So, you can import the function in the django shell? Have you considered
replacing the string-based import with a normal import?

On Sat, Apr 7, 2012 at 16:29, Bussiere  wrote:

> Everything is fine.
>
> I said you it worked five second before ...
>
>
> Bussiere
>
> Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>
>> Reinstalling django will not help. Verify that the file is present and
>> has the correct permissions (likewise all superior directories, and also
>> the relevant __init__.py files. These files are essential.).
>>
>> You may also like to run the django shell, and try to import that module.
>> If that does not work, examine the sys.path setting to ensure that
>> jackpoint is on the path.
>>
>> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>>
>>> i've made no deploiement at all ...
>>>
>>> No views in invitation works.
>>>
>>>
>>> I was working on live with the test server runnning.
>>>
>>> (i've tried to restart it more than one time after i get this error).
>>>
>>> And by magic all the views in invitation don't works, they are not found.
>>>
>>> Maybe a reinstallation of django ?
>>>
>>> Have you any suggestion ?
>>>
>>> Bussiere
>>>
>>>
>>>
>>> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>>>
 Does  invitation/create_invitation **w**ork? If not, I suspect that
 you have either some kind of configuration issue, or the file has gone
 missing from your deployment/has wrong permissions set.

 On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:

> from django.conf.urls.defaults import patterns, include, url
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'Jackpoint.views.home', name='home'),
> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
> url(r'^$', 'jackpoint.engine.views.index'),
> #url(r'^X/$', 'jackpoint.X.views.index'),
> url(r'^invitation/$', 'jackpoint.invitation.views.**in**dex'),
> # Uncomment the admin/doc line below to enable admin documentation:
> url(r'^admin/doc/', include('django.contrib.**admind**ocs.urls')),
>
> url(r'^invitation/create_**invit**ation/$',
> 'jackpoint.invitation.views.**cr**eate_invitation'),
> url(r'^invitation/inscription/$', 'jackpoint.invitation.views.
> **in**vitation_inscription'),
> url(r'^hand/$', 'jackpoint.hand.views.index'),
> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )
>
>
> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>
>> What does your urls.py look like?
>>
>> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>>
>>> i've got this error :
>>> ViewDoesNotExist at /invitation/
>>>
>>> Could not import jackpoint.invitation.views.**index. View does not 
>>> exist in module jackpoint.invitation.views.
>>>
>>>
>>> But yes it exist and worked fine 5 secondes before.
>>>
>>>
>>>  the image of eclipse :
>>>
>>> http://dl.dropbox.com/u/**19753332/wtf.png 
>>> 
>>>
>>>
>>> all the other view works well.
>>>
>>>
>>>
>>> And when i close and reopen firefox, all the views works fine and that 
>>> one appaeras 5 secondes freeze then say it doesn't exist.
>>>
>>>
>>> the view is here :
>>>
>>> https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
>>>  
>>> 
>>>  ** **
>>>
>>>
>>> regards
>>>
>>> bussiere
>>>
>>>
>>>
>>>  --
>>> 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/-/**kiSWlzDrl28J
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscribe@**googlegroups.com
>>> .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>  --
> 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/*
> *ms**g/django-users/-/**KZlOCBWleEMJ

Re: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
Everything is fine.

I said you it worked five second before ...


Bussiere

Le samedi 7 avril 2012 16:58:51 UTC+2, Marcin a écrit :
>
> Reinstalling django will not help. Verify that the file is present and has 
> the correct permissions (likewise all superior directories, and also the 
> relevant __init__.py files. These files are essential.). 
>
> You may also like to run the django shell, and try to import that module. 
> If that does not work, examine the sys.path setting to ensure that 
> jackpoint is on the path. 
>
> On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:
>
>> i've made no deploiement at all ...
>>
>> No views in invitation works.
>>
>>
>> I was working on live with the test server runnning.
>>
>> (i've tried to restart it more than one time after i get this error).
>>
>> And by magic all the views in invitation don't works, they are not found.
>>
>> Maybe a reinstallation of django ?
>>
>> Have you any suggestion ?
>>
>> Bussiere
>>
>>
>>
>> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>>
>>> Does  invitation/create_invitation **work? If not, I suspect that you 
>>> have either some kind of configuration issue, or the file has gone missing 
>>> from your deployment/has wrong permissions set.
>>>
>>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>>
 from django.conf.urls.defaults import patterns, include, url

 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 admin.autodiscover()

 urlpatterns = patterns('',
 # Examples:
 # url(r'^$', 'Jackpoint.views.home', name='home'),
 # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
 url(r'^$', 'jackpoint.engine.views.index'**),
 #url(r'^X/$', 'jackpoint.X.views.index'),
 url(r'^invitation/$', 'jackpoint.invitation.views.**index'),
 # Uncomment the admin/doc line below to enable admin documentation:
 url(r'^admin/doc/', include('django.contrib.**admindocs.urls')),
 
 url(r'^invitation/create_**invitation/$', 
 'jackpoint.invitation.views.**create_invitation'),
 url(r'^invitation/inscription/**$', 'jackpoint.invitation.views.**
 invitation_inscription'),
 url(r'^hand/$', 'jackpoint.hand.views.index'),
 url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
 # Uncomment the next line to enable the admin:
 url(r'^admin/', include(admin.site.urls)),
 )


 Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :

> What does your urls.py look like?
>
> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>
>> i've got this error :
>> ViewDoesNotExist at /invitation/ 
>>
>> Could not import jackpoint.invitation.views.**ind**ex. View does not 
>> exist in module jackpoint.invitation.views.
>>
>>
>> But yes it exist and worked fine 5 secondes before.
>>
>>
>>  the image of eclipse :
>>
>> http://dl.dropbox.com/u/**197533**32/wtf.png 
>>   
>>
>>
>> all the other view works well.
>>
>>
>>
>> And when i close and reopen firefox, all the views works fine and that 
>> one appaeras 5 secondes freeze then say it doesn't exist.
>>
>>
>> the view is here :
>>
>> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>>  
>> 
>>   ** 
>>
>>
>> regards
>>
>> bussiere
>>
>>
>>
>>  -- 
>> 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/
>> **ms**g/django-users/-/**kiSWlzDrl28J
>> .
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscribe@**googl**egroups.com
>> .
>> For more options, visit this group at http://groups.google.com/**
>> group**/django-users?hl=en
>> .
>>
>
>
>
> -- 
> Marcin Tustin
> Tel: 07773 787 105
>
>  -- 
 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/-/**KZlOCBWleEMJ
 .

 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to django-users+unsubscribe@
 **googlegroups.com .
 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en

Re: How can I create a sequence number for a data set in the model?

2012-04-07 Thread Mark Phillips
On Fri, Apr 6, 2012 at 10:58 PM, Dennis Lee Bieber wrote:

> On Fri, 6 Apr 2012 22:34:35 -0700, Mark Phillips
>  declaimed the following in
> gmane.comp.python.django.user:
>
> >
> > Basically, I have sets of data determined by a foreign key, and I want to
> > know the order in which the rows arrive within a data set.
> >
> IOWs, you don't really need a value incrementing per foreign key...
> After all, the primary key already reflects the /order/ of new data
> inserts.
>
>In plain SQL, this might be an application for a "group by" the
> foreign key, "order by" the primary key. Note that your example is NOT
> very clear. "Reset to zero" could result in:
>
> 1   1   1   
> 2   1   2   ...
> 3   2   1   ...
> 4   1   1   ...
> 5   2   1   ...
> 6   2   2   ...
>
> I don't understand what you mean by "reset to zero".


>Whereas, ignoring the example "sequence" column, group by/order by
> would return
>
> 1   1   1   ...
> 2   1   2   ...
> 4   1   1   ...
> 3   2   1   ...
> 5   2   1   ...
> 6   2   2   ...
>
>Actually, just an ORDER BY FK, PK would produce the above... GROUP
> BY would be used if you need something like counts/avg for each FK set.
>

I agree that if the data in the db was entered correctly in the first
place, then just ORDER BY on the FK and PK would be sufficient. However, if
the user needs to insert some data between sequence #3 and sequence #4,
then I have to muck with the primary key of the table, which sounds
dangerous.

Perhaps a better analogy would be to think of a linked list as my in memory
data model, and I want to translate that to a sql table(s). I found a
reference http://www.artfulsoftware.com/mysqlbook/sampler/mysqled1ch20.html,
that may solve my problem.

Apologies for not being clearer in my original post.

Mark

-- 
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: Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-07 Thread Shawn Milochik
On Sat, Apr 7, 2012 at 12:03 AM, xthepoet  wrote:

> This was working fine for my Ubuntu 10.04LTE system with Django
> 1.3.1.  It seems broken now in 1.4.
>
> In Django 1.4, I get this error  TypeError: get_db_prep_value() got an
> unexpected keyword argument 'connection' when saving an image to an
> ImageField.
>
>
Field objects take 'connection' and 'prepared' kwargs in Django 1.4. It
sounds like you're using a custom field which was written before those
parameters existed, or perhaps you upgraded from a previous version and
didn't delete all the .pyc files.

If it's the latter, it's a good idea to completely delete your Django
directory from site-packages before re-installing. If it's the former, you
can add the kwargs with a default of None and pass the values to the
super() call.

-- 
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
Reinstalling django will not help. Verify that the file is present and has
the correct permissions (likewise all superior directories, and also the
relevant __init__.py files. These files are essential.).

You may also like to run the django shell, and try to import that module.
If that does not work, examine the sys.path setting to ensure that
jackpoint is on the path.

On Sat, Apr 7, 2012 at 15:53, Bussiere  wrote:

> i've made no deploiement at all ...
>
> No views in invitation works.
>
>
> I was working on live with the test server runnning.
>
> (i've tried to restart it more than one time after i get this error).
>
> And by magic all the views in invitation don't works, they are not found.
>
> Maybe a reinstallation of django ?
>
> Have you any suggestion ?
>
> Bussiere
>
>
>
> Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>
>> Does  invitation/create_invitation **work? If not, I suspect that you
>> have either some kind of configuration issue, or the file has gone missing
>> from your deployment/has wrong permissions set.
>>
>> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>>
>>> from django.conf.urls.defaults import patterns, include, url
>>>
>>> # Uncomment the next two lines to enable the admin:
>>> from django.contrib import admin
>>> admin.autodiscover()
>>>
>>> urlpatterns = patterns('',
>>> # Examples:
>>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls'))**,
>>> url(r'^$', 'jackpoint.engine.views.index'**),
>>> #url(r'^X/$', 'jackpoint.X.views.index'),
>>> url(r'^invitation/$', 'jackpoint.invitation.views.**index'),
>>> # Uncomment the admin/doc line below to enable admin documentation:
>>> url(r'^admin/doc/', include('django.contrib.**admindocs.urls')),
>>>
>>> url(r'^invitation/create_**invitation/$',
>>> 'jackpoint.invitation.views.**create_invitation'),
>>> url(r'^invitation/inscription/**$', 'jackpoint.invitation.views.**
>>> invitation_inscription'),
>>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>>> # Uncomment the next line to enable the admin:
>>> url(r'^admin/', include(admin.site.urls)),
>>> )
>>>
>>>
>>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>>
 What does your urls.py look like?

 On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:

> i've got this error :
> ViewDoesNotExist at /invitation/
>
> Could not import jackpoint.invitation.views.**ind**ex. View does not 
> exist in module jackpoint.invitation.views.
>
>
> But yes it exist and worked fine 5 secondes before.
>
>
> the image of eclipse :
>
> http://dl.dropbox.com/u/**197533**32/wtf.png 
> 
>
>
> all the other view works well.
>
>
>
> And when i close and reopen firefox, all the views works fine and that 
> one appaeras 5 secondes freeze then say it doesn't exist.
>
>
> the view is here :
>
> https://github.com/bussiere/**ja**ckpoint/blob/master/**jackpoint/**jackpoint/**invitation/views.py
>  
> 
>   **
>
>
> regards
>
> bussiere
>
>
>
>  --
> 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/*
> *ms**g/django-users/-/**kiSWlzDrl28J
> .
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@**googl**egroups.com
> .
> For more options, visit this group at http://groups.google.com/**group
> **/django-users?hl=en
> .
>



 --
 Marcin Tustin
 Tel: 07773 787 105

  --
>>> 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/-/**KZlOCBWleEMJ
>>> .
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>  --
> 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/-/m-QAVDODpUUJ

orange svm

2012-04-07 Thread dummyman dummyman
Hi,

Is anyone  having experience in orange tool.

I need a help

Orange tutorials explains how to load data from a .tab file
But my requirement is i ve  a list in python which needs to be supplied as
input to orange svm

Is there a way to convert list to orange.tab format ?
I know this is  a django group but still wanted to know if anyone has used
it b4

pl help me
thnks in advance

-- 
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.



cache decorators in urls.py error

2012-04-07 Thread Phang Mulianto
Hi,

i have my apps and try to use cache decorator in url.py but got error.

Here are the urls.py

from django.views.decorators.cache import cache_page

urlpatterns = patterns('article.views',
#(r'^$','index', { 'template_name': 'blog/public_list.html'}, 'index'),
(r'^$',cache_page('index'), { 'template_name':
'blog/public_list.html'}, 'index'),
)

the error is :

cache_page must be passed a view function if called with two arguments

what is wrong in the url.. note i also use the DDT (django debug toolbar) .

THanks for pointing me out..

-- 
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
i've made no deploiement at all ...

No views in invitation works.


I was working on live with the test server runnning.

(i've tried to restart it more than one time after i get this error).

And by magic all the views in invitation don't works, they are not found.

Maybe a reinstallation of django ?

Have you any suggestion ?

Bussiere



Le samedi 7 avril 2012 16:42:09 UTC+2, Marcin a écrit :
>
> Does  invitation/create_invitation work? If not, I suspect that you have 
> either some kind of configuration issue, or the file has gone missing from 
> your deployment/has wrong permissions set.
>
> On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:
>
>> from django.conf.urls.defaults import patterns, include, url
>>
>> # Uncomment the next two lines to enable the admin:
>> from django.contrib import admin
>> admin.autodiscover()
>>
>> urlpatterns = patterns('',
>> # Examples:
>> # url(r'^$', 'Jackpoint.views.home', name='home'),
>> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
>> url(r'^$', 'jackpoint.engine.views.index'),
>> #url(r'^X/$', 'jackpoint.X.views.index'),
>> url(r'^invitation/$', 'jackpoint.invitation.views.index'),
>> # Uncomment the admin/doc line below to enable admin documentation:
>> url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>> 
>> url(r'^invitation/create_invitation/$', 
>> 'jackpoint.invitation.views.create_invitation'),
>> url(r'^invitation/inscription/$', 
>> 'jackpoint.invitation.views.invitation_inscription'),
>> url(r'^hand/$', 'jackpoint.hand.views.index'),
>> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
>> # Uncomment the next line to enable the admin:
>> url(r'^admin/', include(admin.site.urls)),
>> )
>>
>>
>> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>>
>>> What does your urls.py look like?
>>>
>>> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>>>
 i've got this error :
 ViewDoesNotExist at /invitation/ 

 Could not import jackpoint.invitation.views.**index. View does not exist 
 in module jackpoint.invitation.views.


 But yes it exist and worked fine 5 secondes before.


 the image of eclipse :

 http://dl.dropbox.com/u/**19753332/wtf.png 
   


 all the other view works well.



 And when i close and reopen firefox, all the views works fine and that one 
 appaeras 5 secondes freeze then say it doesn't exist.


 the view is here :

 https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
  
 



 regards

 bussiere



  -- 
 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/-/**kiSWlzDrl28J
 .
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to django-users+unsubscribe@
 **googlegroups.com .
 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>
>>>
>>> -- 
>>> Marcin Tustin
>>> Tel: 07773 787 105
>>>
>>>  -- 
>> 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/-/KZlOCBWleEMJ.
>>
>> 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.
>>
>
>
>
> -- 
> Marcin Tustin
> Tel: 07773 787 105
>
>

-- 
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/-/m-QAVDODpUUJ.
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
Does  invitation/create_invitation work? If not, I suspect that you have
either some kind of configuration issue, or the file has gone missing from
your deployment/has wrong permissions set.

On Sat, Apr 7, 2012 at 15:36, Bussiere  wrote:

> from django.conf.urls.defaults import patterns, include, url
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'Jackpoint.views.home', name='home'),
> # url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
> url(r'^$', 'jackpoint.engine.views.index'),
> #url(r'^X/$', 'jackpoint.X.views.index'),
> url(r'^invitation/$', 'jackpoint.invitation.views.index'),
> # Uncomment the admin/doc line below to enable admin documentation:
> url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> url(r'^invitation/create_invitation/$',
> 'jackpoint.invitation.views.create_invitation'),
> url(r'^invitation/inscription/$',
> 'jackpoint.invitation.views.invitation_inscription'),
> url(r'^hand/$', 'jackpoint.hand.views.index'),
> url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
> # Uncomment the next line to enable the admin:
> url(r'^admin/', include(admin.site.urls)),
> )
>
>
> Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>
>> What does your urls.py look like?
>>
>> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>>
>>> i've got this error :
>>> ViewDoesNotExist at /invitation/
>>>
>>> Could not import jackpoint.invitation.views.**index. View does not exist in 
>>> module jackpoint.invitation.views.
>>>
>>>
>>> But yes it exist and worked fine 5 secondes before.
>>>
>>>
>>> the image of eclipse :
>>>
>>> http://dl.dropbox.com/u/**19753332/wtf.png 
>>> 
>>>
>>>
>>> all the other view works well.
>>>
>>>
>>>
>>> And when i close and reopen firefox, all the views works fine and that one 
>>> appaeras 5 secondes freeze then say it doesn't exist.
>>>
>>>
>>> the view is here :
>>>
>>> https://github.com/bussiere/**jackpoint/blob/master/**jackpoint/jackpoint/**invitation/views.py
>>>  
>>> 
>>>
>>>
>>> regards
>>>
>>> bussiere
>>>
>>>
>>>
>>>  --
>>> 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/-/**kiSWlzDrl28J
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>  --
> 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/-/KZlOCBWleEMJ.
>
> 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.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Jackpoint.views.home', name='home'),
# url(r'^Jackpoint/', include('Jackpoint.foo.urls')),
url(r'^$', 'jackpoint.engine.views.index'),
#url(r'^X/$', 'jackpoint.X.views.index'),
url(r'^invitation/$', 'jackpoint.invitation.views.index'),
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

url(r'^invitation/create_invitation/$', 
'jackpoint.invitation.views.create_invitation'),
url(r'^invitation/inscription/$', 
'jackpoint.invitation.views.invitation_inscription'),
url(r'^hand/$', 'jackpoint.hand.views.index'),
url(r'^hand/ask/$', 'jackpoint.hand.views.ask'),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)


Le samedi 7 avril 2012 16:28:53 UTC+2, Marcin a écrit :
>
> What does your urls.py look like?
>
> On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:
>
>> i've got this error :
>> ViewDoesNotExist at /invitation/ 
>>
>> Could not import jackpoint.invitation.views.index. View does not exist in 
>> module jackpoint.invitation.views.
>>
>>
>> But yes it exist and worked fine 5 secondes before.
>>
>>
>> the image of eclipse :
>>
>> http://dl.dropbox.com/u/19753332/wtf.png 
>>
>>
>> all the other view works well.
>>
>>
>>
>> And when i close and reopen firefox, all the views works fine and that one 
>> appaeras 5 secondes freeze then say it doesn't exist.
>>
>>
>> the view is here :
>>
>> https://github.com/bussiere/jackpoint/blob/master/jackpoint/jackpoint/invitation/views.py
>>   
>>
>>
>> regards
>>
>> bussiere
>>
>>
>>
>>  -- 
>> 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/-/kiSWlzDrl28J.
>> 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.
>>
>
>
>
> -- 
> Marcin Tustin
> Tel: 07773 787 105
>
>

-- 
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/-/KZlOCBWleEMJ.
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: It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Marcin Tustin
What does your urls.py look like?

On Sat, Apr 7, 2012 at 15:27, Bussiere  wrote:

> i've got this error :
> ViewDoesNotExist at /invitation/
>
> Could not import jackpoint.invitation.views.index. View does not exist in 
> module jackpoint.invitation.views.
>
>
> But yes it exist and worked fine 5 secondes before.
>
>
> the image of eclipse :
>
> http://dl.dropbox.com/u/19753332/wtf.png
>
>
> all the other view works well.
>
>
>
> And when i close and reopen firefox, all the views works fine and that one 
> appaeras 5 secondes freeze then say it doesn't exist.
>
>
> the view is here :
>
> https://github.com/bussiere/jackpoint/blob/master/jackpoint/jackpoint/invitation/views.py
>
>
> regards
>
> bussiere
>
>
>
>  --
> 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/-/kiSWlzDrl28J.
> 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.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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.



It's magic the view does not exist for django but it worked 5 secondes before and it still exist

2012-04-07 Thread Bussiere
i've got this error :
ViewDoesNotExist at /invitation/ 

Could not import jackpoint.invitation.views.index. View does not exist in 
module jackpoint.invitation.views.


But yes it exist and worked fine 5 secondes before.


the image of eclipse :

http://dl.dropbox.com/u/19753332/wtf.png


all the other view works well.



And when i close and reopen firefox, all the views works fine and that one 
appaeras 5 secondes freeze then say it doesn't exist.


the view is here :

https://github.com/bussiere/jackpoint/blob/master/jackpoint/jackpoint/invitation/views.py
 


regards

bussiere



-- 
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/-/kiSWlzDrl28J.
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.



Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-07 Thread xthepoet
This was working fine for my Ubuntu 10.04LTE system with Django
1.3.1.  It seems broken now in 1.4.

In Django 1.4, I get this error  TypeError: get_db_prep_value() got an
unexpected keyword argument 'connection' when saving an image to an
ImageField.

System (installed from Ubuntu Lucid repository packages):
Django 1.4
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)

The model field is defined as: origin_image =
models.ImageField(upload_to='images/origin')
The offending call is: obj.origin_image.save(fbFileName,
ContentFile(input_file.getvalue()))

Traceback (most recent call last):
  File "/home/seeker/src/ceeq/seekerapp/management/commands/
addUser.py", line 100, in addPhotos
obj.origin_image.save(fbFileName,
ContentFile(input_file.getvalue()))
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/fields/files.py", line 95, in save
self.instance.save()
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/base.py", line 551, in save_base
result = manager._insert([self], fields=fields,
return_id=update_pk, using=using, raw=raw)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/query.py", line 1576, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/sql/compiler.py", line 909, in execute_sql
for sql, params in self.as_sql():
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/sql/compiler.py", line 872, in as_sql
for obj in self.query.objs
  File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
django/db/models/fields/__init__.py", line 292, in get_db_prep_save
prepared=False)
TypeError: get_db_prep_value() got an unexpected keyword argument
'connection'

This problem was also reported on the django-celery board:
https://github.com/ask/celery/issues/624
But I've realized that for me, it's not a celery issue.

-- 
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.



Strange behaviour when annotating.

2012-04-07 Thread M. Can Bayrak
Hello, i have a question, but it's hard to write as an email so i wrote a blog 
post
. 

Thanks for your response.

-- 
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/-/DZgYyBdLzuMJ.
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: Why using Generic Views?

2012-04-07 Thread Phang Mulianto
HI,

i understand why need to use generic views after i code some of my function
like showing list of data, and the view is the same and i end up copy paste
it , not type it (smarter huh?) , just change my db object and pass to my
template.

well , generic view is come in the rescue and we can produce faster result
with less code, just call the generic function  in the url.py files and
point to your template to render.

hope help..

Mulianto

On Wed, Apr 4, 2012 at 10:36 PM, Dan Gentry  wrote:

> I use generic views - either function or class based - for the common
> functionality in my apps.  As Serge mentioned, a list works pretty
> much the same in every application, so I just provide a few parameters
> to a generic view.  More complicated forms still require custom code.
>
> On Apr 3, 1:07 am, abisson  wrote:
> > Good evening,
> >
> > I just finished the Django 1.4 Tutorial, and I really don't understand
> > the point of Generic Views in Django? As far as I can see, we wrote
> > more code than before, and what other example would make the Generic
> > Views better than normal views?
> >
> > Thanks for the clarifications!
>
> --
> 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.
>
>

-- 
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: AttributeError at /admin/coltrane/entry/add/ 'Entry' object has no attribute 'pubdate'

2012-04-07 Thread laurence Turpin
Thank you  akaariai for replying to my post.
When I looked at the problem the next day I had a different problem.
I have since learnt that when you create a django project in eclipse you 
should not select the option for an src folder as it confuse django. I have
therefore decided to restart from scratch.

On Wednesday, 4 April 2012 08:43:09 UTC+1, akaariai wrote:
>
> Do you get a stacktrace from the error? You should get one, and it 
> should point out the code-path to the erroneous pubdate usage. If you 
> do not get one for one reason or another, search your project for the 
> string "pubdate" and go through all locations containing that string. 
>
> The code snippets you have below seem clean to me. 
>
>  - Anssi 
>
> On Apr 3, 10:59 pm, laurence Turpin  
> wrote: 
> > Hello, 
> > 
> > I'm trying to learn Django from the book "Practical Django Projects 2nd 
> > Edition" 
> >  I'm using Django 1.3.1 and Python 2.7.2 on Windows 7 
> > Also I'm using Eclipse Indigo with pydev 
> > 
> > The current project I'm working on is to create a Weblog called 
> coltrane. 
> > coltrane is an application that exists in a project called 
> > "cmswithpythonanddjango" 
> > 
> > Inside the models.py is a class called Entry which holds the fields used 
> to 
> > Enter a weblog entry. 
> > When I go to localhost:8000/admin/I get the option to add and Entry. 
> > I can select this option fill out sample data, but when I try to save 
> it. 
> > I get the following error. 
> > 
> > AttributeError at /admin/coltrane/entry/add/ 
> > 
> > 'Entry' object has no attribute 'pubdate' 
> > 
> > There is a field called pub_date in Entry 
> > 
> > It's as if I have made a typing error somewhere and typed pubdate 
> instead of pub_date. 
> > 
> > Below is the models.py, views.py , url.py , and admin.py files 
> > 
> > 
> //
>  
>
> > 
> > Here is my models.py 
> > 
> > 
> /
>  
>
> > 
> > from django.db import models 
> > import datetime 
> > from tagging.fields import TagField 
> > from django.contrib.auth.models import User 
> > from markdown import markdown 
> > 
> > class Category(models.Model): 
> > title = models.CharField(max_length=250, help_text="Maximum 250 
> > characters.") 
> > slug = models.SlugField(help_text="Suggested value automatically 
> > generated from title. Must be unique.") 
> > description = models.TextField() 
> > 
> > class Meta: 
> > ordering = ['title'] 
> > verbose_name_plural = "Categories" 
> > 
> > def __unicode__(self): 
> > return self.title 
> > 
> > def get_absolute_url(self): 
> > return "/categories/%s/" % self.slug 
> > 
> > class Entry(models.Model): 
> > LIVE_STATUS = 1 
> > DRAFT_STATUS = 2 
> > HIDDEN_STATUS = 3 
> > STATUS_CHOICES = ( 
> > (LIVE_STATUS, 'Live'), 
> > (DRAFT_STATUS, 'Draft'), 
> > (HIDDEN_STATUS, 'Hidden') 
> > ) 
> > 
> > # Core fields 
> > title = models.CharField(max_length=250, help_text = "Maximum 250 
> > characters. ") 
> > excerpt = models.TextField(blank=True, help_text = "A short summary 
> of 
> > the entry. Optional.") 
> > body = models.TextField() 
> > pub_date = models.DateTimeField(default = datetime.datetime.now) 
> > 
> > # Fields to store generated HTML 
> > excerpt_html = models.TextField(editable=False, blank=True) 
> > body_html = models.TextField(editable=False, blank=True) 
> > 
> > # Metadata 
> > author = models.ForeignKey(User) 
> > enable_comments = models.BooleanField(default=True) 
> > featured = models.BooleanField(default=False) 
> > slug = models.SlugField(unique_for_date = 'pub_date', help_text = 
> > "Suggested value automatically generated from title. Must be unique.") 
> > status = models.IntegerField(choices=STATUS_CHOICES, 
> > default=LIVE_STATUS, help_text = "Only entries with live status will be 
> > publicly displayed.") 
> > 
> > # Categorization. 
> > categories = models.ManyToManyField(Category) 
> > tags = TagField(help_text = "Separate tags with spaces.") 
> > 
> > class Meta: 
> > verbose_name_plural = "Entries" 
> > ordering = ['-pub_date'] 
> > 
> > def __unicode__(self): 
> > return self.title 
> > 
> > def save(self, force_insert=False, force_update=False): 
> > self.body_html = markdown(self.body) 
> > if self.excerpt: 
> > self.excerpt_html = markdown(self.excerpt) 
> > super(Entry, self).save(force_insert, force_update) 
> > 
> > def get_absolute_url(self): 
> > return "/weblog/%s/%s/" % 
> > (sel

Re: Improving Site Performance

2012-04-07 Thread Phang Mulianto
Well.. i think the lazy query is on action.

The query executed to get the data from database to be use in your view, if
you said requestContext(..)

if you remove it, of course the data will not available in your
view/template.

To reduce the query executed everytime you call the page, try use query
caching..
one quick way without change code is use some cache like johnny-cache..it
will automaticly cache your query and unvalidate it if your data changes.

i used it to.. and try load your page more than once, you will see in the
debug toolbar, the query is reduced in the second and next load...that is
the cache in action..

hope help..

On Thu, Apr 5, 2012 at 3:41 PM, Swaroop Shankar V wrote:

> Hi All,
> Am developing a site using django and it is almost ready to be launched.
> Right now am trying to optimize the performance of the site. I have
> installed the django debug toolbar and when i checked the number of queries
> being exicuted on the homepage i could see there are 74 queries
> being executed. On debugging I could see that most of the queries  are
> through the context_instance=RequestContext(request) that am passing to a
> view. When I removed it I could see the queries where reduced to 24, which
> improved the performance, but I end up in an error
>
> Caught KeyError while rendering: 'request'
>
> this is happening because the homepage is rendering a custom template tag 
> which requires the request object available (to access the currently logged 
> in user details). So is there any way to avoid using 
> context_instance=RequestContext(request) and still make the request object 
> accessible in the custom template tag?
>
> Thanks and Regards,
> Swaroop Shankar V
>
>  --
> 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.
>

-- 
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.



Templates and Models

2012-04-07 Thread Sophia
Hi all,


I have the following form( TextBox ) :



I wrote the following Model as an input for the TextBox, and when we write 
a subject in the text box and press Enter it should be shown in another box 
above the TextBox :

class Company(models.Model):
Subject = models.CharField(max_length=30)

def __unicode__(self):
return self.Subject


I don't know how to relate these two together, would you please give me a 
hint?

Thanks in advance.
Sophia

-- 
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/-/zwvAcQ3M2RIJ.
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 1.5 static files strangeness

2012-04-07 Thread Mike Dewhirst

My bad. Not a bug.

In my urls.py ...

if settings.DEBUG:

urlpatterns += patterns('',
(r'^media\/(?P.*)$',
'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
)

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns += staticfiles_urlpatterns()

... which is needed to find the static files and not wanted with Apache.

Sorry

Mike


On 5/04/2012 2:52pm, Mike Dewhirst wrote:

I'm getting odd static files 404 behaviour switching to DEBUG = False on
my Windows XP dev machine.

My staging server is Linux running under Apache and the same code and
the same version of Django and that is running fine with DEBUG = FALSE

See the 200 versus 404 info below ...

 manage.py runserver DEBUG = False ###
Validating models...

0 errors found
Django version 1.5.dev17868, using settings 'strxs.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[05/Apr/2012 14:29:20] "GET /admin/company/company/2/ HTTP/1.1" 200 85287
[05/Apr/2012 14:29:21] "GET /admin/jsi18n/ HTTP/1.1" 200 2158
[05/Apr/2012 14:29:21] "GET /static/css/darker.css HTTP/1.1" 404 504
[05/Apr/2012 14:29:21] "GET /static/js/tiny_mce/tiny_mce.js HTTP/1.1"
404 504
[05/Apr/2012 14:29:23] "GET /static/js/tiny_mce/tiny_mce.js HTTP/1.1"
404 504
###


Note that when DEBUG = True a number of settings are printed.
 manage.py runserver DEBUG = True ###
SETTINGS_DIR = C:/users/miked/py/strxs/strxs
APP_ROOT = C:/users/miked/py/strxs (root for all app dirs)
FIXTURE_DIRS = C:/users/miked/py/strxs/fixtures
MEDIA_ROOT = /srv/www/strxs/media/ (store uploaded images etc)
MEDIA_URL = /media/ (to serve uploaded images)
STATIC_ROOT = /srv/www/strxs/static/ (collectstatic destination)
STATIC_URL = /static/ (to serve css, js etc)
STATICFILES_DIRS#1 = C:/users/miked/py/strxs/static/
STATICFILES_DIRS#2 = C:/users/miked/py/strxs/company/static/
TEMPLATE_DIRS#1 = C:/users/miked/py/strxs/templates/

Validating models...

0 errors found
Django version 1.5.dev17868, using settings 'strxs.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[05/Apr/2012 14:30:18] "GET /admin/company/company/2/ HTTP/1.1" 200 85271
[05/Apr/2012 14:30:19] "GET /static/css/darker.css HTTP/1.1" 200 274
[05/Apr/2012 14:30:19] "GET /admin/jsi18n/ HTTP/1.1" 200 2158
[05/Apr/2012 14:30:20] "GET /static/js/tiny_mce/tiny_mce.js HTTP/1.1"
200 207762
###

The workaround is obviously to use DEBUG = True on the dev machine

Might be a bug

Mike


--
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.