Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Nigel Legg
Two thoughts:
1.  If you are analysing tweets, why are you deleting on a daily basis?
Wouldn't a longer term view give you a better picture?
2.  Why not use the status_id field from the tweet as your id? The twitter
have the problem of dealing with it's size, and you will (should, or at
least could) be getting it in the JSON you download.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 August 2013 23:37, Javier Guerra Giraldez  wrote:

> On Mon, Aug 5, 2013 at 4:52 PM, Sean Whalen  wrote:
> > How can the models be configured to use bigserial? I know I could convert
> > the tables myself, but that is not helpful for distributing the app.
>
>
> https://docs.djangoproject.com/en/1.5/ref/django-admin/#sqlcustom-appname-appname
>
> you can provide custom SQL commands that are executed right after
> table creation by syncdb.  in short, just add
> "/sql/.sql" or
> "/sql/..sql" files.
>
>
> i guess South also provides some way to express the same change as a
> migration.
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Graph in django

2013-08-05 Thread amanjot kaur
I am plotting a graph in django using matplotlib. I am entering all
the values manually but I want to fetch the values from database in
views.py.

-- 
Amanjot Kaur

Blog: kauramanjot35.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: got different result from same filter in requests(django1.5)

2013-08-05 Thread Zhouhf

I found, each request will call a new connection to mysql in django1.4 
while not in django1.5,
in django1.5, connections will be cached and reused by new requests. Thus, 
there be a problem,
the MySQLdb need a  explicit connection.commit() before or after every 
connection.execute() in order to
get the latest updated data from mysql (UPDATE or INSERT could be execute 
in another shell or connection).
And, the django1.5 does not do connection.commit() before any filter() by 
default.
Then, I think the next step is to find out if there is any option in 
django1.5 to do this commit()


在 2013年8月5日星期一UTC+8下午6时13分21秒,Zhouhf写道:
>
> recently I ran into a problem whitch doubt me a lot,
>
> I did some UPDATE in MySQL:  UPDATE tablename SET content="B"  where 
> content="A";
> and commit, exit shell of MySQL
> then **with no reload uwsgi**
> model.objects.filter() in views.py just got different result in 
> requests,like:
> (request1)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "A"}
> (request2)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
> (request3)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "A"}
> (request4)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "A"}
> (request5)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "A"}
> (request6)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
># this is wrong
>
>**after reload uwsgi**
> (request1)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
> (request2)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
> (request3)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
> (request4)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
> (request5)   http://.../request/:   --- got -->  {"id": 1, 
> "content": "B"}
># this is correct
>
> filter(parameters** ), parameters is all the same (unchanged),  but 
> diffrent return,
> then I test in django1.4.5,  no such problem,
> this happens in django1.5.0 and 1.5.1  and ...
>
>
> so I wonder if I did someting wrong or there is anything wrong with 
> django1.5,
> Anybody has the same problem? Or ,anyone can help? thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Testing with legacy data

2013-08-05 Thread Jani Tiainen
Hi,

I've legacy database that is rather large (around 300MB) containing lot more 
than just data (triggers, stored procedures and such).

Now how I can test with such a data? Preferably I would like to load data to 
database, run test, rollback changes and run a next test.

But I really wouldn't like to recreate database from the scratch everytime or 
not to import data every time. 

Any suggestions how I could proceed?

-- 

Jani Tiainen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Ovnicraft
On Mon, Aug 5, 2013 at 11:46 PM, Harjot Mann wrote:

> On Tue, Aug 6, 2013 at 9:17 AM, Ovnicraft  wrote:
> > I recommend you use wkhthmltopdf, it is a great library and you can use
> any
> > JS library to render graphs.
>
>
> How can we use it in django?
>

wkhtmltopdf convert pages to pdf, if you generate an html: with django
templates for example save it in /tmp then call wk  with subprocess you get
the pdf report.

Check: https://github.com/incuna/django-wkhtmltopdf

Regards,


>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Cristian Salamea
@ovnicraft

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Harjot Mann
On Tue, Aug 6, 2013 at 9:17 AM, Ovnicraft  wrote:
> I recommend you use wkhthmltopdf, it is a great library and you can use any
> JS library to render graphs.


How can we use it in django?

-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Browsing a certain website within another website?

2013-08-05 Thread Somnath
is it possible to browse certain website within another website in django?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django for corporate web site

2013-08-05 Thread Mike Dewhirst

On 6/08/2013 2:07pm, sean chen wrote:

I need to build a site for a small law firm. I looked at the poweredby
pages http://www.djangosites.org/, but I found it shows sites for
different purposes and I did not find a good example site for me to
spark my thoughts further.

I see there exists a focus area for e-commerce site at
https://www.djangopackages.com/grids/g/ecommerce/, is there a focus area
for corporate websites?


What do they want?

Mike



Thanks,
Sean

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Django for corporate web site

2013-08-05 Thread sean chen
I need to build a site for a small law firm. I looked at the poweredby 
pages http://www.djangosites.org/, but I found it shows sites for different 
purposes and I did not find a good example site for me to spark my thoughts 
further.

I see there exists a focus area for e-commerce site at 
https://www.djangopackages.com/grids/g/ecommerce/, is there a focus area 
for corporate websites?

Thanks,
Sean

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Best way to make a view for a simple post-comment page?

2013-08-05 Thread Ben Spatafora


Beginner here looking for advice as to the simplest, best-practicey way to 
do this.

Right now I'm just piping a generic, class-based DetailView to a template 
that displays an instance of a "Post" model and all of its ForeignKey 
"Comment" model instances.

I'd like to keep things as simple, even generic as possible (seems like 
CBVs are good for this?), as the only additional functionality I need is 
the ability to create and delete comments. I'm looking to have a simple 
form (just a textarea) beneath the original post, as well as beneath each 
comment (all these forms will at some point be hidden behind a link by 
default using Javascript).

I've been trying to figure out the best way to do this, but there seem to 
be multiple possible ways, and it's hard to determine which would be best. 
Nudges in the right direction appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Ovnicraft
On Mon, Aug 5, 2013 at 1:48 AM, navnath gadakh wrote:

> Which is best tool to generate PDF in python django


I recommend you use wkhthmltopdf, it is a great library and you can use any
JS library to render graphs.

Regards,


>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Cristian Salamea
@ovnicraft

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Nick Apostolakis
Hello there, I have used the report lab library with good results for
simple PDF with tabular data
On 5 Aug 2013 16:27, "graeme"  wrote:

> I recently used Latex and it worked fairly well.
>
> I had to write a little function to escape latex special characters, and
> you have to be a bit careful with some characters when mixing Latex and
> Django templates.
>
> It would not be easy if you needed to insert formatted text into the
> template, but it works fine, is well tested and documented, and the results
> look quite good.
>
> On Monday, August 5, 2013 12:18:40 PM UTC+5:30, navnath gadakh wrote:
>>
>> Which is best tool to generate PDF in python django
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Custom model fields not working?

2013-08-05 Thread joe . yuan19
Hey!
I'm dealing with a similar issue. 
Would you be able to tell me if you managed to solve this issue? 
and if so, how?

Thanks!
Joe

On Tuesday, December 11, 2007 3:42:54 PM UTC-5, oli...@obeattie.com wrote:
>
> Hey everyone, 
>
> I've asked a little in the Django IRC, but nobody seems to be able to 
> help. I'm trying to implement a custom model field, and I really can't 
> figure out why I keep getting errors. My code for my fields module is 
> at http://dpaste.com/hold/27712/ 
>
> When I try to run syncdb on a model which uses the PickledObjectField 
> (see my sample model at http://dpaste.com/hold/27713/), I get this 
> traceback:- 
>
> Macintosh:sandbox Oliver$ cd /Django/sandbox && python manage.py 
> syncdb 
> Traceback (most recent call last): 
>   File "manage.py", line 11, in  
> execute_manager(settings) 
>   File "/Django Source/django/core/management/__init__.py", line 272, 
> in execute_manager 
> utility.execute() 
>   File "/Django Source/django/core/management/__init__.py", line 219, 
> in execute 
> self.fetch_command(subcommand).run_from_argv(self.argv) 
>   File "/Django Source/django/core/management/base.py", line 70, in 
> run_from_argv 
> self.execute(*args, **options.__dict__) 
>   File "/Django Source/django/core/management/base.py", line 83, in 
> execute 
> self.validate() 
>   File "/Django Source/django/core/management/base.py", line 110, in 
> validate 
> num_errors = get_validation_errors(s, app) 
>   File "/Django Source/django/core/management/validation.py", line 28, 
> in get_validation_errors 
> for (app_name, error) in get_app_errors().items(): 
>   File "/Django Source/django/db/models/loading.py", line 126, in 
> get_app_errors 
> self._populate() 
>   File "/Django Source/django/db/models/loading.py", line 55, in 
> _populate 
> self.load_app(app_name, True) 
>   File "/Django Source/django/db/models/loading.py", line 70, in 
> load_app 
> mod = __import__(app_name, {}, {}, ['models']) 
>   File "/Django/sandbox/../sandbox/geo/models.py", line 247, in 
>  
> class TestModel(models.Model): 
>   File "/Django Source/django/db/models/base.py", line 62, in __new__ 
> new_class.add_to_class(obj_name, obj) 
>   File "/Django Source/django/db/models/base.py", line 184, in 
> add_to_class 
> value.contribute_to_class(cls, name) 
> TypeError: Error when calling the metaclass bases 
> unbound method contribute_to_class() must be called with 
> PickledObjectField instance as first argument (got ModelBase instance 
> instead) 
> Macintosh:sandbox Oliver$ 
>
> Can anyone point me in the right direction? 
>
> Thanks so much, 
> Oliver

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Errno 13] Permission denied: '.cache' - where is the directory I need to change permission

2013-08-05 Thread Mike Doroshenko II
I am curious about this,  is there a file called .cache in your 
project's directory?


On 8/3/2013 9:28 AM, Frank He wrote:
I am now deploying my django project using apache mod_wsgi, after a 
lot effort, it is near the end. But now when I run my project 
directly, I am stuck with a permission issue, and got this error:



  OSError at /

[Errno 13] Permission denied: '.cache'
Request Method: GET
Request URL:http://10.3.94.239/
Django Version: 1.4
Exception Type: OSError
Exception Value:
[Errno 13] Permission denied: '.cache'
Exception Location: /usr/lib/python2.6/os.py in makedirs, line 157
Python Executable:  /usr/bin/python


I believe this is because the cache can not be written, so natually,  
I need to change its permission. But WHERE?


I don't know how to find out the directory.

Can you tell me anything about this?

Thanks very much in advance. --
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Admin Center is not displaying

2013-08-05 Thread Cole Calhoun
For some reason, my tutorial would switch from the 1.5 version to the 1.7 
version without me noticing. Once I did notice, I realized that I had not 
yet completed the third step. Everything seems to be in working order now. 
Thank you so much for the help!

On Monday, August 5, 2013 4:16:35 AM UTC-7, Phil wrote:
>
> There are 3 steps in the documentation. You seem to have done the first 2, 
> but what about your mysite/urls.py file? Did you uncomment those lines:
>
> # Uncomment the next two lines to enable the admin:*from django.contrib 
> import admin**admin.autodiscover()*
>
> Regards,
> Phil
>
> On Sunday, August 4, 2013 12:57:33 AM UTC-3, Cole Calhoun wrote:
>>
>> I am running Python 2.7.4 and Django 1.5.1 on a Mac.
>>
>> I completed the first part of the "Writing your first Django app." 
>> tutorial (https://docs.djangoproject.com/en/1.5/intro/tutorial01/) and 
>> everything went as the tutorial explained. Once I got to the second part of 
>> the tutorial, it asked me to add /admin/ to my local dev url, nothing 
>> rendered. I didn't receive any errors in the terminal, but the site stayed 
>> the same, I saw no changes.
>>
>> One thing I did notice while going through the tutorial was that in 
>> mysite/settings.py the django.contrib.app was not included. Once I noticed 
>> that, I added it, synced the database again, but it still wouldn't work. 
>> The tutorial says that it is meant for version 1.5 and 2.+ and I am running 
>> 1.5.1.
>>
>> If anyone has any insight as to what the problem may be, that would be 
>> greatly appreciated.
>>
>> Thanks!
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Are Web frameworks useful in mobile first world?

2013-08-05 Thread Russell Keith-Magee
On Mon, Aug 5, 2013 at 9:19 PM, zweb  wrote:

>
> Are web frameworks useful in mobile first world of today?
>
> With apps required to support multiple front ends including Mobile and
> Web, is using a web framework like ROR or Django more of a liability.
>
> Would not a light weight rest framework be better?
>

Sure. Use a lightweight framework.

Then you need to expose a series of API endpoints, so you add a URL routing
library to your stack.

Then you discover that you need to supply your API with data, so you need
an ORM or some other data library.

Then you need to handle user inputs, so you need a data validation library.

Then you need to handle authentication, so you plug in a bunch of
authentication and user account library.

And all of a sudden, your "lightweight" framework is the same weight the
same as Django -- except that you've had to spend a bunch of time
evaluating ORMs, URL routers, data validators, and authentication
libraries, learning out how they work, and working out how to tie them all
together.

Don't get me wrong -- there are some very good lightweight frameworks, and
a lightweight framework *might* be the right solution for your situation --
it's impossible to say without more details. Ultimately, you need to
evaluate your own situation and make a call.

However, don't fall into trap of believing that "lightweight" frameworks
are a panacea that avoid all the 'bloat' of Django. Django is the size it
is for a reason. Lightweight frameworks have made design decisions to omit
features, and those design decisions have consequences.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Javier Guerra Giraldez
On Mon, Aug 5, 2013 at 4:52 PM, Sean Whalen  wrote:
> How can the models be configured to use bigserial? I know I could convert
> the tables myself, but that is not helpful for distributing the app.

https://docs.djangoproject.com/en/1.5/ref/django-admin/#sqlcustom-appname-appname

you can provide custom SQL commands that are executed right after
table creation by syncdb.  in short, just add
"/sql/.sql" or
"/sql/..sql" files.


i guess South also provides some way to express the same change as a migration.

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Drew Ferguson
On Mon, 5 Aug 2013 14:26:00 -0700 (PDT)
Sean Whalen  wrote:

> I have a Django/PostgreSQL application to analyze data from tweets. The 
> dataset increases by thousands of records with each request. I am using
> the database primarily as a relational cache, so I had planned to delete
> all records every 24 hours to permit new requests, without needlessly 
> increasing the size of the database.
> 
> However, because the Django ORM uses the
> SERIALdata
> type to store the IDs in the DB; the IDs get larger, even when all
> existing records have been deleted. Eventually, I will run out of key
> space. What can I do to make Django produce smaller ID values?
> 

Rather than deleting records could you truncate the table instead? Then
you can reset the sequence with this...

TRUNCATE mytable RESTART IDENTITY

http://www.postgresql.org/docs/9.1/interactive/sql-truncate.html

-- 
Drew Ferguson

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Sean Whalen
How can the models be configured to use bigserial? I know I could convert
the tables myself, but that is not helpful for distributing the app.

It looks like someone requested that feature three years ago.

https://code.djangoproject.com/ticket/14286


On Mon, Aug 5, 2013 at 5:36 PM, Javier Guerra Giraldez
wrote:

> On Mon, Aug 5, 2013 at 4:26 PM, Sean Whalen  wrote:
> > However, because the Django ORM uses the SERIAL data type to store the
> IDs
> > in the DB; the IDs get larger, even when all existing records have been
> > deleted. Eventually, I will run out of key space. What can I do to make
> > Django produce smaller ID values?
>
>
> instead of "producing smaller ID values" (which could potentially
> collide if you decide to keep a few "old" records), try switching to
> bigserial.  even if you get a million requests per day, producing a
> billion new records, you won't exhaust the keyspace before several
> billion days (almost 50 million years from now)
>
> --
> Javier
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/Ro7TOBuBEQg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: how get user session name in models django??

2013-08-05 Thread Bill Freeman
By session name, I presume that you mean the name of the user whose request
caused you to call a model method.

If that is correct, then you can't unless the view logic has passed the
request object (or equivalent, such as the username) to the model method in
question.  (There are various schemes using thread local storage to allow a
middleware to save request based information where indirectly called code
can find it without the cooperation of the intervening code layers.  They
are a pain to get "right".)

Bill


On Mon, Aug 5, 2013 at 2:45 PM, raul salinas wrote:

> Hi guys
>
> how get user session name in models django??
>
> i tried:
> from django.contrib.auth.models import User
>
> class myclass (models.Model):
> def myuser ():
> user = User.objects.get()
> return user
> 
> establec = models.CharField(max_length=200,default=myuser)
>
> but that would be wrong ...any idea?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Avoiding huge IDs after deleting data

2013-08-05 Thread Javier Guerra Giraldez
On Mon, Aug 5, 2013 at 4:26 PM, Sean Whalen  wrote:
> However, because the Django ORM uses the SERIAL data type to store the IDs
> in the DB; the IDs get larger, even when all existing records have been
> deleted. Eventually, I will run out of key space. What can I do to make
> Django produce smaller ID values?


instead of "producing smaller ID values" (which could potentially
collide if you decide to keep a few "old" records), try switching to
bigserial.  even if you get a million requests per day, producing a
billion new records, you won't exhaust the keyspace before several
billion days (almost 50 million years from now)

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Avoiding huge IDs after deleting data

2013-08-05 Thread Sean Whalen
I have a Django/PostgreSQL application to analyze data from tweets. The 
dataset increases by thousands of records with each request. I am using the 
database primarily as a relational cache, so I had planned to delete all 
records every 24 hours to permit new requests, without needlessly 
increasing the size of the database.

However, because the Django ORM uses the 
SERIALdata
 type to store the IDs in the DB; the IDs get larger, even when all 
existing records have been deleted. Eventually, I will run out of key 
space. What can I do to make Django produce smaller ID values?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Update to the list of images

2013-08-05 Thread Hélio Miranda
Hi
My problem is this, I have a field that is a list of ids of the images 
stored in a register.
The issue is that I want to insert an image, and then later want to add 
another image over it erases the list and put there just the id of this 
image saved now, and I wanted to update the list, leaving the id that there 
was and added the new.

My code is this:
def uploadEquipment (request, id):

 if request.method == 'POST':

 my_painting Club.objects.get = (id = id)
 print my_painting.equipment
 files = []

 request.FILES.getlist for f in ('file'):
#  guard file in GridFS
mf = mongoengine.fields.GridFSProxy ()
mf.put (f, filename = f.name, legend = 'Hi')
# -
files.append (mf) # update the list
my_painting.equipment = files
 my_painting.save ()

Someone can help me how to do this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




how get user session name in models django??

2013-08-05 Thread raul salinas
Hi guys 

how get user session name in models django??

i tried:
from django.contrib.auth.models import User

class myclass (models.Model):
def myuser ():
user = User.objects.get()
return user

establec = models.CharField(max_length=200,default=myuser)

but that would be wrong ...any idea?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Are Web frameworks useful in mobile first world?

2013-08-05 Thread Alex Mandel
On 08/05/2013 06:19 AM, zweb wrote:
> 
> Are web frameworks useful in mobile first world of today?
> 
> With apps required to support multiple front ends including Mobile and Web, 
> is using a web framework like ROR or Django more of a liability.
> 
> Would not a light weight rest framework be better?
> 
> ( Note: I really like Django. It is an awesome web framework.)
> 

REST is a style of url patterns, you still need something to respond to
those requests with data in the right format:
http://django-rest-framework.org/
http://django-tastypie.readthedocs.org/en/latest/

etc...

Enjoy,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to store position of current/active navigation entry

2013-08-05 Thread Bill Freeman
On Sun, Aug 4, 2013 at 6:39 AM, DJ-Tom  wrote:

> Hi,
>
> I don't think I know how to actually do what you are suggesting.
>
> Lets say I have three menu options with the following URLS:
>
> "One" - /one/show
> "Two" - /two/show
> "Three" - /three/show
>
> Currently I have somthing like this in my main.html page template:
>
> {% if navi %}
>> {% for entry in navi %}
>> {{ 
>> entry.name}}
>> {% endfor %}
>> {%  endif %}
>>
>
> With the following view function:
>
> def show_mainPage(request):
>>
>> navigation = [ {'href':'/one', 'name':"One"},
>>{'href':'/two', 'name':"Two"},
>>{'href':'/three', 'name':"Three"}]
>> return TemplateResponse(request, 'main_page/main.html', {'navi':
>> navigation, 'main_settings':main_settings.objects.get(id=1)})
>>
>
> So how would I set the "active" CSS class in my template for the correct
> nav entry?
>
> Perhaps I don't understand the nature of the problem.  I'm assuming that
the nav entry to be highlighted by default is a function of which page is
being viewed.  Further, I presume that you know which page to display
because a GET request was issued (either vanilla or AJAX), and the path
part of the URL (possibly in combination with query parameters, if you have
a truly complex scheme) allows the combination of your urlpatterns and view
functions to know what to render.  It follows (to me, at least) that the
information available in the request is enough to know which item should be
highlighted.

If that's correct, then nclude whatever attribute you need to on a navi
entry object that it can be compared with a value derived from the request
(either in your view, in a template tag, or (best) placed in the context by
a template context processor (still has to be a request context to give you
access to the request object)).  Use this with an "if" tag to control
adding a class to the "li" element (for instance) which, in common with
simple CSS, highlights it.

There are also schemes with mutually unique classes on your "li" elements,
the same, or related, class as for the one to be highlighted on a
containing element, and a set of CSS rules, one for each highlight-able
menu item, to highlight the "li" if the outer class is an ancestor of the
corresponding "LI"'s class.  This is messy, potentially requiring
dynamically generated CSS if your Nav tree changes dynamically.  The use
case is where you are pulling new data through AJAX to morph the page into
a new one, so that a new menu item should be highlighted.  The JavaScript
need only change the class on the outer element, allowing your to to avoid
having to loop across the nav removing the one highlight class (from the
first approach), or from the one that your JavaScript knows was
highlighted, before applying it to the newly selected "li" (mutually unique
classes are still a help to this JavaScript).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Oracle reconnection

2013-08-05 Thread Jerome Cordonnier
Hi,

I am currently working on an custom python application, and I am using 
Django (v1.5.1) as backend module to handle my database connection. This 
application basically use 3 differents thread, that all access to the 
database thanks to Django, and if everything work fine with Mysql, I have 
an issue with Oracle.

The problem is if my application loose the connection to the database, let 
say because of a network failure, it never succeed to reconnect to Oracle 
event when the network come back alive (work fine with mysql).

My oracle configuration :
ORACLE = {
'default': {
  'ENGINE': 'oracle',
  'NAME': 'oracle_database',
  'USER': 'oracle_user',
  'PASSWORD': 'oracle_pwd',
  'HOST': '',
  'PORT': '',
  'OPTIONS': {
'threaded': True,
'use_returning_into': False,
},
  }
}

I tried to use django.db.close_connection() and 
django.db.connection.close() without any success.

Is someone have an idea of what I am doing wrong ?

Thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Admin Center is not displaying

2013-08-05 Thread Keith Edmiston
I experienced similar troubles just last week. The remedy for me was to 
delete all cookies and cache in my Firefox (on a PC).  Then it worked again.

Hope that helps...Keith

On Saturday, August 3, 2013 10:57:33 PM UTC-5, Cole Calhoun wrote:
>
> I am running Python 2.7.4 and Django 1.5.1 on a Mac.
>
> I completed the first part of the "Writing your first Django app." 
> tutorial (https://docs.djangoproject.com/en/1.5/intro/tutorial01/) and 
> everything went as the tutorial explained. Once I got to the second part of 
> the tutorial, it asked me to add /admin/ to my local dev url, nothing 
> rendered. I didn't receive any errors in the terminal, but the site stayed 
> the same, I saw no changes.
>
> One thing I did notice while going through the tutorial was that in 
> mysite/settings.py the django.contrib.app was not included. Once I noticed 
> that, I added it, synced the database again, but it still wouldn't work. 
> The tutorial says that it is meant for version 1.5 and 2.+ and I am running 
> 1.5.1.
>
> If anyone has any insight as to what the problem may be, that would be 
> greatly appreciated.
>
> Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Bring real data tables with FK

2013-08-05 Thread Giulio Calacoci

Good.

well if you use to serialize Models often your solution is the best and 
probably the cleaner one :)


Nice work :)

Regards.

Giulio


Il 05/08/2013 16:28, Mário Idival ha scritto:

thanks for answering my question... But i find an way better for this.

I create an gist explaining how to do : 
https://gist.github.com/marioidival/6156074



Thanks!

Mário Idival

*Twitter *: */@marioigd/*
*Facebook*: */mario.idival/*
/*User Linux* :**/*#554446*
Skype/: marioidival/
*Blog: *https://conconcus.wordpress.com


2013/8/5 Giulio Calacoci >


Hi,

How do you fill the JSON?
You use the Document class as Main entity ?

Because if you have a Document entity, simply use the internal
reference to the related object.

example:

Assuming that you are filling a Map and then use the map for a
quick JSON transform.

{
'Document id': document.id ,
'Related Layout id': document.layout.id
,
'Related Layout Name', document.layout.name
,
}

or you can perform a query using the Django orm, using the
document_id as filter.
Example:

layout =
Layout.objects.get(document_id=)

This is just a guess of how things works on your program... but
maybe it's a starting idea.
Or maybe I've misunderstood you problem and I'm totally wrong :D

Regards
Giulio.



Il 05/08/2013 14:49, Mário Idival ha scritto:

Good morning,
I have this situation:

I have 3 classes, Document, Layout and Company

1 Document has 1 Layout 1 and Company ..
Document class:
layout = models.ForeignKey (Layout)
company = models.ForeignKey (Company)

I have a search page that is being filled by JSON, then the data
layout and the company is returning the ID of them respectively,
and the ideal would be to show the names of each data (Name and
Company Name Layout) ..

How can I accomplish this query so that I quoted above?

Sincerely, o /
Mário Idival

*Twitter *: */@marioigd/*
*Facebook*: */mario.idival/*
/*User Linux* :**/*#554446*
Skype/: marioidival/
*Blog: *https://conconcus.wordpress.com
-- 
You received this message because you are subscribed to the

Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to
django-users@googlegroups.com .
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Bring real data tables with FK

2013-08-05 Thread Mário Idival
thanks for answering my question... But i find an way better for this.

I create an gist explaining how to do :
https://gist.github.com/marioidival/6156074


Thanks!

Mário Idival

*Twitter *: *@marioigd*
*Facebook*: *mario.idival*
*User Linux : **#554446*
Skype*: marioidival*
*Blog:  *https://conconcus.wordpress.com


2013/8/5 Giulio Calacoci 

>  Hi,
>
> How do you fill the JSON?
> You use the Document class as Main entity ?
>
> Because if you have a Document entity, simply use the internal reference
> to the related object.
>
> example:
>
> Assuming that you are filling a Map and then use the map for a quick JSON
> transform.
>
> {
> 'Document id': document.id,
> 'Related Layout id': document.layout.id,
> 'Related Layout Name', document.layout.name,
> }
>
> or you can perform a query using the Django orm, using the document_id as
> filter.
> Example:
>
> layout =
> Layout.objects.get(document_id=)
>
> This is just a guess of how things works on your program... but maybe it's
> a starting idea.
> Or maybe I've misunderstood you problem and I'm totally wrong :D
>
> Regards
> Giulio.
>
>
>
> Il 05/08/2013 14:49, Mário Idival ha scritto:
>
>  Good morning,
> I have this situation:
>
>  I have 3 classes, Document, Layout and Company
>
>  1 Document has 1 Layout 1 and Company ..
> Document class:
> layout = models.ForeignKey (Layout)
> company = models.ForeignKey (Company)
>
>  I have a search page that is being filled by JSON, then the data layout
> and the company is returning the ID of them respectively, and the ideal
> would be to show the names of each data (Name and Company Name Layout) ..
>
>  How can I accomplish this query so that I quoted above?
>
>  Sincerely, o /
>  Mário Idival
>
>   *Twitter *: *@marioigd*
> *Facebook*: *mario.idival*
> *User Linux : **#554446*
>  Skype*: marioidival*
>  *Blog:  *https://conconcus.wordpress.com
>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Bring real data tables with FK

2013-08-05 Thread Giulio Calacoci

Hi,

How do you fill the JSON?
You use the Document class as Main entity ?

Because if you have a Document entity, simply use the internal reference 
to the related object.


example:

Assuming that you are filling a Map and then use the map for a quick 
JSON transform.


{
'Document id': document.id,
'Related Layout id': document.layout.id,
'Related Layout Name', document.layout.name,
}

or you can perform a query using the Django orm, using the document_id 
as filter.

Example:

layout = Layout.objects.get(document_id=)

This is just a guess of how things works on your program... but maybe 
it's a starting idea.

Or maybe I've misunderstood you problem and I'm totally wrong :D

Regards
Giulio.



Il 05/08/2013 14:49, Mário Idival ha scritto:

Good morning,
I have this situation:

I have 3 classes, Document, Layout and Company

1 Document has 1 Layout 1 and Company ..
Document class:
layout = models.ForeignKey (Layout)
company = models.ForeignKey (Company)

I have a search page that is being filled by JSON, then the data 
layout and the company is returning the ID of them respectively, and 
the ideal would be to show the names of each data (Name and Company 
Name Layout) ..


How can I accomplish this query so that I quoted above?

Sincerely, o /
Mário Idival

*Twitter *: */@marioigd/*
*Facebook*: */mario.idival/*
/*User Linux* :**/*#554446*
Skype/: marioidival/
*Blog: *https://conconcus.wordpress.com
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't run manage.py runserver (Django 1.5.1)

2013-08-05 Thread gilberto dos santos alves
at beginning of each of your python file put this directive for declare 
that your files are using this encode. review what text editor you are 
using and when you save your files verify that is using unicode utf-8. many 
times this occurs when use accent chars like (õ, é, etc) like in portuguese 
this error occurs when leve windows coding generally cp-1250 or cp-1252.

 # -*- coding: utf-8 -*-


Em domingo, 4 de agosto de 2013 15h38min11s UTC-3, Anton Yermolenko 
escreveu:
>
> Hi guys
>
> i'm new to python as well as django. Seeking help for this problem
>
> I have python 3.3 installed and django 1.5.1 on win 7
> so when i run manage.py runserver i got this error message
>
> c:\mysite>python manage.py runserver
> Validating models...
>
> 0 errors found
> August 04, 2013 - 18:51:37
> Django version 1.5.1, using settings 'mysite.settings'
> Development server is running at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Error: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start 
> byte
>
> Googling didn't help, unfortunately
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: implement gmail type address adding functionality in django

2013-08-05 Thread Fred Stluka

Roopa,

The word to search is "autocomplete".

Check out:
http://api.jqueryui.com/autocomplete/

It is a JavaScript widget.  We use it with Django.  It runs in our
Web page, and does an Ajax call to our Django code, which
pulls the list of completions from our DB.

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.


On 8/5/13 6:12 AM, roopasingh...@gmail.com wrote:

Hi,

  What is the name of that technology i want to search in google.

Cheers!


On Monday, August 5, 2013 3:29:21 PM UTC+5:30, JirkaV wrote:

(not on a PC now)

You're looking for quite common functionality - search you
favourite search engine for combination of Django, Ajax and
"typeahead"

HTH

Jirka

*From: * roopas...@gmail.com 
*Sender: * django...@googlegroups.com 
*Date: *Mon, 5 Aug 2013 00:50:06 -0700 (PDT)
*To: *>
*ReplyTo: * django...@googlegroups.com 
*Subject: *implement gmail type address adding functionality in django

I want to implement the functionality available for adding email
address in gmail in my application.

In gmail,in compose mail if we type the 1st character of the email
address,it will show the list of suggested email address.The same
concept,i want to implement in django for contact name.The list of
names are saved in database,so typing any letter of the name,it
should show the list of suggested names and from that user can
select the name.

I need some post or blog to get an idea to do this.


Cheers!

Roopa

-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-users...@googlegroups.com .
To post to this group, send email to django...@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users
.
For more options, visit https://groups.google.com/groups/opt_out
.


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread graeme
I recently used Latex and it worked fairly well.

I had to write a little function to escape latex special characters, and 
you have to be a bit careful with some characters when mixing Latex and 
Django templates.

It would not be easy if you needed to insert formatted text into the 
template, but it works fine, is well tested and documented, and the results 
look quite good.

On Monday, August 5, 2013 12:18:40 PM UTC+5:30, navnath gadakh wrote:
>
> Which is best tool to generate PDF in python django
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Are Web frameworks useful in mobile first world?

2013-08-05 Thread zweb

Are web frameworks useful in mobile first world of today?

With apps required to support multiple front ends including Mobile and Web, 
is using a web framework like ROR or Django more of a liability.

Would not a light weight rest framework be better?

( Note: I really like Django. It is an awesome web framework.)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to check if DEBUG is True in template?

2013-08-05 Thread Drew Ferguson
On Mon, 5 Aug 2013 03:41:49 -0700 (PDT)
cui ye  wrote:

> As title.
> 

http://stackoverflow.com/questions/433162/can-i-access-constants-in-settings-py-from-templates-in-django

Gives has an extensive answer with several alternatives
-- 
Drew Ferguson

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Bring real data tables with FK

2013-08-05 Thread Mário Idival
Good morning,
I have this situation:

I have 3 classes, Document, Layout and Company

1 Document has 1 Layout 1 and Company ..
Document class:
layout = models.ForeignKey (Layout)
company = models.ForeignKey (Company)

I have a search page that is being filled by JSON, then the data layout and
the company is returning the ID of them respectively, and the ideal would
be to show the names of each data (Name and Company Name Layout) ..

How can I accomplish this query so that I quoted above?

Sincerely, o /
Mário Idival

*Twitter *: *@marioigd*
*Facebook*: *mario.idival*
*User Linux : **#554446*
Skype*: marioidival*
*Blog:  *https://conconcus.wordpress.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: not able to run applets

2013-08-05 Thread Phil
How are you invoking the applet? Could you show your relevant code 
(template)?

Regards,
Phil

On Monday, August 5, 2013 5:08:12 AM UTC-3, Kaushik Roy wrote:
>
> hello everyone,
>
> i am a new user of django and i am doing a small project for my course. i 
> can show static content like images, css and scripts, but 
> my applets are not running at all. i have a simple hello world applet and 
> its not showing. could anyone throw some light on this? its important for 
> me.
>
> is there any difference between how normal static content and applets are 
> dealt with?
>
> cheers,
> Kaushik
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can't run manage.py runserver (Django 1.5.1)

2013-08-05 Thread Phil
Without knowing more what you are doing, it is hard to help. But it seems 
like you are trying to decode as utf-8 something encoded differently. 
Please provide more information about what you are doing with Django.

Regards,
Phil

On Sunday, August 4, 2013 3:38:11 PM UTC-3, Anton Yermolenko wrote:
>
> Hi guys
>
> i'm new to python as well as django. Seeking help for this problem
>
> I have python 3.3 installed and django 1.5.1 on win 7
> so when i run manage.py runserver i got this error message
>
> c:\mysite>python manage.py runserver
> Validating models...
>
> 0 errors found
> August 04, 2013 - 18:51:37
> Django version 1.5.1, using settings 'mysite.settings'
> Development server is running at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Error: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start 
> byte
>
> Googling didn't help, unfortunately
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to check if DEBUG is True in template?

2013-08-05 Thread Nigel Legg
It i in settings.py, not in template.

Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 5 August 2013 11:41, cui ye  wrote:

> As title.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: implement gmail type address adding functionality in django

2013-08-05 Thread Amit Yadav
I think what you are looking for is named as AUTOCOMPLETE.
You can search jquery-ui autocomplete

On Monday, August 5, 2013 3:42:05 PM UTC+5:30, roopas...@gmail.com wrote:
>
> Hi,
>
>   What is the name of that technology i want to search in google.
>
> Cheers!
>
>
> On Monday, August 5, 2013 3:29:21 PM UTC+5:30, JirkaV wrote:
>>
>> (not on a PC now)
>>
>> You're looking for quite common functionality - search you favourite 
>> search engine for combination of Django, Ajax and "typeahead"
>>
>> HTH
>>
>> Jirka
>> --
>> *From: * roopas...@gmail.com 
>> *Sender: * django...@googlegroups.com 
>> *Date: *Mon, 5 Aug 2013 00:50:06 -0700 (PDT)
>> *To: *
>> *ReplyTo: * django...@googlegroups.com 
>> *Subject: *implement gmail type address adding functionality in django
>>
>> I want to implement the functionality available for adding email address 
>> in gmail in my application.
>>
>> In gmail,in compose mail if we type the 1st character of the email 
>> address,it will show the list of suggested email address.The same concept,i 
>> want to implement in django for contact name.The list of names are saved in 
>> database,so typing any letter of the name,it should show the list of 
>> suggested names and from that user can select the name.
>>
>> I need some post or blog to get an idea to do this.
>>
>>
>> Cheers!
>>
>> Roopa 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




How to check if DEBUG is True in template?

2013-08-05 Thread cui ye
As title.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




got different result from same filter in requests(django1.5)

2013-08-05 Thread Zhouhf
recently I ran into a problem whitch doubt me a lot,

I did some UPDATE in MySQL:  UPDATE tablename SET content="B"  where 
content="A";
and commit, exit shell of MySQL
then **with no reload uwsgi**
model.objects.filter() in views.py just got different result in 
requests,like:
(request1)   http://.../request/:   --- got -->  {"id": 1, 
"content": "A"}
(request2)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
(request3)   http://.../request/:   --- got -->  {"id": 1, 
"content": "A"}
(request4)   http://.../request/:   --- got -->  {"id": 1, 
"content": "A"}
(request5)   http://.../request/:   --- got -->  {"id": 1, 
"content": "A"}
(request6)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
   # this is wrong

   **after reload uwsgi**
(request1)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
(request2)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
(request3)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
(request4)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
(request5)   http://.../request/:   --- got -->  {"id": 1, 
"content": "B"}
   # this is correct

filter(parameters** ), parameters is all the same (unchanged),  but 
diffrent return,
then I test in django1.4.5,  no such problem,
this happens in django1.5.0 and 1.5.1  and ...


so I wonder if I did someting wrong or there is anything wrong with 
django1.5,
Anybody has the same problem? Or ,anyone can help? thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




not able to run applets

2013-08-05 Thread Kaushik Roy
hello everyone,

i am a new user of django and i am doing a small project for my course. i 
can show static content like images, css and scripts, but 
my applets are not running at all. i have a simple hello world applet and 
its not showing. could anyone throw some light on this? its important for 
me.

is there any difference between how normal static content and applets are 
dealt with?

cheers,
Kaushik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Admin Center is not displaying

2013-08-05 Thread Phil
There are 3 steps in the documentation. You seem to have done the first 2, 
but what about your mysite/urls.py file? Did you uncomment those lines:

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

Regards,
Phil

On Sunday, August 4, 2013 12:57:33 AM UTC-3, Cole Calhoun wrote:
>
> I am running Python 2.7.4 and Django 1.5.1 on a Mac.
>
> I completed the first part of the "Writing your first Django app." 
> tutorial (https://docs.djangoproject.com/en/1.5/intro/tutorial01/) and 
> everything went as the tutorial explained. Once I got to the second part of 
> the tutorial, it asked me to add /admin/ to my local dev url, nothing 
> rendered. I didn't receive any errors in the terminal, but the site stayed 
> the same, I saw no changes.
>
> One thing I did notice while going through the tutorial was that in 
> mysite/settings.py the django.contrib.app was not included. Once I noticed 
> that, I added it, synced the database again, but it still wouldn't work. 
> The tutorial says that it is meant for version 1.5 and 2.+ and I am running 
> 1.5.1.
>
> If anyone has any insight as to what the problem may be, that would be 
> greatly appreciated.
>
> Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Oivvio Polite
On Sun, Aug 04, 2013 at 11:48:40PM -0700, navnath gadakh wrote:
> Which is best tool to generate PDF in python django
> 

I've been using wkhtmltopdf as well. It's very easy to use. Results are
ok, but not stellar. Sometimes the font kerning feels a bit of. I use it
to generate PDF invoices and for that use it's just fine. I probably
wouldn't feel comfortable to use it for something like an e-book though.

oivvio

-- 
Oivvio Polite - http://liberationtech.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: implement gmail type address adding functionality in django

2013-08-05 Thread roopasingh250
Hi,

  What is the name of that technology i want to search in google.

Cheers!


On Monday, August 5, 2013 3:29:21 PM UTC+5:30, JirkaV wrote:
>
> (not on a PC now)
>
> You're looking for quite common functionality - search you favourite 
> search engine for combination of Django, Ajax and "typeahead"
>
> HTH
>
> Jirka
> --
> *From: * roopas...@gmail.com  
> *Sender: * django...@googlegroups.com  
> *Date: *Mon, 5 Aug 2013 00:50:06 -0700 (PDT)
> *To: *>
> *ReplyTo: * django...@googlegroups.com  
> *Subject: *implement gmail type address adding functionality in django
>
> I want to implement the functionality available for adding email address 
> in gmail in my application.
>
> In gmail,in compose mail if we type the 1st character of the email 
> address,it will show the list of suggested email address.The same concept,i 
> want to implement in django for contact name.The list of names are saved in 
> database,so typing any letter of the name,it should show the list of 
> suggested names and from that user can select the name.
>
> I need some post or blog to get an idea to do this.
>
>
> Cheers!
>
> Roopa 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using standard Django admin User forms for Custom User model?

2013-08-05 Thread cubells
S

, Vicent Cubells,
Tel: 659 06 36 1w4.

- Reply message -
From: "Victor Hooi" 
To: 
Subject: Using standard Django admin User forms for Custom User model?
Date: dl., ag. 5, 2013 11:21
Hi,
I got it working at a basic level by just registering against UserAdmin.
from django.contrib.auth.admin import UserAdmin
admin.site.register(Customer, UserAdmin)
For custom fields, I just needed to add them to fieldsets.
However, even though I could view/edit users, adding new Users failed - the 
forms seemed to be looking specifically for auth_user.

Apparently this is something that could be made easier?
https://code.djangoproject.com/ticket/19353
http://stackoverflow.com/a/17496836/139137

Is that something that could be in 1.6?
Cheers,Victor

On Thursday, 1 August 2013 09:45:51 UTC+10, Russell Keith-Magee  wrote:
On Wed, Jul 31, 2013 at 12:36 PM, Victor Hooi  wrote:

Hi,
When you add a Django User through the admin, it presents you with a initial 
screen to enter a username and password  (/admin/auth/user/add/), and then 
handles hashing for you.

Also, when you go to edit a User, it gives you a Change Password form (e.g. 
/admin/auth/user/2/password/)
I'm using a custom user model in my Django app, by inheriting from 
AbstractCustomer.

If I add this to the admin now, password is just a standard textbox, and 
obviously if I create a user through that, I can't login since I assume it's 
not hashing the password.

Is there any way I can use the normal Django User admin forms with a custom 
User model?
Secondly, I tried creating a user via the create_user() method on my custom 
User object - I still wasn't able to login to the admin using that 
username/password, which I thought was weird.

Have you read the documentation on this issue? 
https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms

The docs discuss what you have to do in order to get your User model 
represented in the admin, and also provide a worked example.
If you've got a specific question that isn't covered by the docs, or if you're 
confused by what the docs say, let us know.

Yours,Russ Magee %-)




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: implement gmail type address adding functionality in django

2013-08-05 Thread jirka . vejrazka
(not on a PC now)

  You're looking for quite common functionality - search you favourite search 
engine for combination of Django, Ajax and "typeahead"

 HTH

Jirka

-Original Message-
From: roopasingh...@gmail.com
Sender: django-users@googlegroups.com
Date: Mon, 5 Aug 2013 00:50:06 
To: 
Reply-To: django-users@googlegroups.com
Subject: implement gmail type address adding functionality in django



I want to implement the functionality available for adding email address in 
gmail in my application.

In gmail,in compose mail if we type the 1st character of the email 
address,it will show the list of suggested email address.The same concept,i 
want to implement in django for contact name.The list of names are saved in 
database,so typing any letter of the name,it should show the list of 
suggested names and from that user can select the name.

I need some post or blog to get an idea to do this.


Cheers!

Roopa 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using standard Django admin User forms for Custom User model?

2013-08-05 Thread Victor Hooi
Hi,

I got it working at a basic level by just registering against UserAdmin.

from django.contrib.auth.admin import UserAdmin
> admin.site.register(Customer, UserAdmin)


For custom fields, I just needed to add them to fieldsets.

However, even though I could view/edit users, adding new Users failed - the 
forms seemed to be looking specifically for auth_user.

Apparently this is something that could be made easier?

https://code.djangoproject.com/ticket/19353
http://stackoverflow.com/a/17496836/139137

Is that something that could be in 1.6?

Cheers,
Victor

On Thursday, 1 August 2013 09:45:51 UTC+10, Russell Keith-Magee wrote:
>
>
> On Wed, Jul 31, 2013 at 12:36 PM, Victor Hooi 
> > wrote:
>
>> Hi,
>>
>> When you add a Django User through the admin, it presents you with a 
>> initial screen to enter a username and password  (/admin/auth/user/add/), 
>> and then handles hashing for you.
>>
>> Also, when you go to edit a User, it gives you a Change Password form 
>> (e.g. /admin/auth/user/2/password/)
>>
>> I'm using a custom user model in my Django app, by inheriting from 
>> AbstractCustomer.
>>
>> If I add this to the admin now, password is just a standard textbox, and 
>> obviously if I create a user through that, I can't login since I assume 
>> it's not hashing the password.
>>
>> Is there any way I can use the normal Django User admin forms with a 
>> custom User model?
>>
>> Secondly, I tried creating a user via the create_user() method on my 
>> custom User object - I still wasn't able to login to the admin using that 
>> username/password, which I thought was weird.
>>
>
> Have you read the documentation on this issue? 
>
>
> https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms
>
> The docs discuss what you have to do in order to get your User model 
> represented in the admin, and also provide a worked example.
>
> If you've got a specific question that isn't covered by the docs, or if 
> you're confused by what the docs say, let us know.
>
> Yours,
> Russ Magee %-)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem with static in Django 1.5 virtualenv

2013-08-05 Thread Tom Evans
On Fri, Aug 2, 2013 at 9:55 PM, Jairo Alonso Velásquez
 wrote:
> Problem is due to a bug on Django or Python, You should to set DEBUG = True
> in settings.py And problem gone.
>
>
> https://bugzilla.redhat.com/show_bug.cgi?id=962223
>
> Hope this helps others.

No, when DEBUG is False, Django does not serve or do anything with
your static files.

You are expected to run "collectstatic" command to collect your static
files in to the folder indicated by settings.STATIC_ROOT, which is
then expected to be made available by you at the URL indicated by
settings.STATIC_URL, ie not using django at all.

This is documented fully in the section of the docs "Deploying static files":

"""
The basic outline of putting static files into production is simple:
run the collectstatic command when static files change, then arrange
for the collected static files directory (STATIC_ROOT) to be moved to
the static file server and served. Depending on STATICFILES_STORAGE,
files may need to be moved to a new location manually or the
post_process method of the Storage class might take care of that.
"""

https://docs.djangoproject.com/en/1.5/howto/static-files/deployment/#serving-static-files-in-production

This is not a bug, this is how it is supposed to work.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Save url containing special characters into mysql database using cursor object

2013-08-05 Thread Tom Evans
On Sat, Aug 3, 2013 at 8:04 PM, fanchyna  wrote:
>
>
>
> I am about to save the url below to my mysql database (innodb) using the
> cursor object:
>
>
> http://www-i6.informatik.rwth-aachen.de/publications/download/367/l{o}{o}fjonasbisanimaximiliangollanchrisianheigoldgeorghoffmeisterbj{o}rnplahlchristianschl{u}terralfneyhermann--the2006{rwth}parliamentaryspeechestranscriptionsystem--2006.pdf
>

What special characters are in that string?

> the insert statement is
>
> dbquery = "INSERT INTO maintable (url,state) VALUES (%s,%s)"
> dbqueryvalue = (url,'0')
>
> The cursor.execute(dbquery,dbqueryvalue)

So, not using django?

>
> error:
>
> _mysql_exceptions.Warning: Data truncated for column 'url' at row 1
>
> Other urls seem to be OK, but on this one cannot be saved.The url field
> can save up to 255 characters so the string length is not the problem.

That error message from mysql indicates that the data supplied is too
large for the column specified and has been truncated. Either your
table structure does not allow for 242 characters in that column, or
that's not the URL you are trying to insert. This WFM when I attempt
to reproduce your issue.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




ANNOUNCE: importd 0.2.0 released

2013-08-05 Thread Amit Upadhyay
Hello everyone,

I am pleased to announce I have released 0.2.0 of importd. 

Documentation: http://pythonhosted.org/importd/.

ChangeLog :

   - BACKWARD INCOMPATIBLE: remove atexit magic, d.main() is the replacement
   - gunicorn cleanly exits now
   - tests, support django 1.4.3 and 1.5.1 for each of python 2.6, 2.7 and 
   3.3
   - less magic, no more sys.modules tweaking
   - runserver now reloads when any file changes
   - added auto generated MANIFEST.in (using check-manifest)
   - added support for mounting urls to custom locations
   
Feedback appreciated,

Thanks

-- 
Amit Upadhyay
amitu.com [+1 (408) 464-8800]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




implement gmail type address adding functionality in django

2013-08-05 Thread roopasingh250


I want to implement the functionality available for adding email address in 
gmail in my application.

In gmail,in compose mail if we type the 1st character of the email 
address,it will show the list of suggested email address.The same concept,i 
want to implement in django for contact name.The list of names are saved in 
database,so typing any letter of the name,it should show the list of 
suggested names and from that user can select the name.

I need some post or blog to get an idea to do this.


Cheers!

Roopa 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PDF generator in Django

2013-08-05 Thread Sanjay Bhangar
On Mon, Aug 5, 2013 at 12:27 PM, Nigel Legg  wrote:

> I'm currently looking at ReportLab following
> https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ - but open to
> suggestions.
>
>
i have used wkhtmltopdf for this .. not a django / python tool per se, but
I could make my pages as normal with a template, etc. and then point
wkhtmltopdf to the URL and it generates pretty clean PDFs .. I found it
easier to generate html / css and then have another tool take care of
converting that to a PDF, and wkhtmltopdf worked quite well for that. Your
use-case may vary, but if that seems interesting and you need any help /
clarification, let me know ..

-Sanjay


> Regards,
> Nigel Legg
> 07914 740972
> http://www.trevanianlegg.co.uk
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
>
>
>
> On 5 August 2013 07:48, navnath gadakh  wrote:
>
>> Which is best tool to generate PDF in python django
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.