Re: A lots of foreign keys - Django Admin

2012-09-25 Thread rentgeeen
I postet the query above in the 1st post, it takes like 17secs, 1 of them 
like 60 secs

SELECT `auto_type`.`id`, `auto_type`.`client_id`,
`auto_type`.`category_id`, `auto_type`.`subcategory_id`,
`auto_type`.`project_id`, `auto_type`.`title`, `auto_client`.`id`,
`auto_client`.`title`, `auto_category`.`id`, `auto_category`.`client_id`,
`auto_category`.`title`, T4.`id`, T4.`title`, `auto_subcategory`.`id`,
`auto_subcategory`.`client_id`, `auto_subcategory`.`category_id`,
`auto_subcategory`.`title`, T6.`id`, T6.`title`, T7.`id`, T7.`client_id`,
T7.`title`, T8.`id`, T8.`title`, `auto_project`.`id`,
`auto_project`.`client_id`, `auto_project`.`category_id`,
`auto_project`.`subcategory_id`, `auto_project`.`title`, T10.`id`,
T10.`title`, T11.`id`, T11.`client_id`, T11.`title`, T12.`id`,
T12.`title`, T13.`id`, T13.`client_id`, T13.`category_id`, T13.`title`,
T14.`id`, T14.`title`, T15.`id`, T15.`client_id`, T15.`title`, T16.`id`,
T16.`title` FROM `auto_type` INNER JOIN `auto_client` ON
(`auto_type`.`client_id` = `auto_client`.`title`) INNER JOIN
`auto_category` ON (`auto_type`.`category_id` = `auto_category`.`title`)
INNER JOIN `auto_client` T4 ON (`auto_category`.`client_id` = T4.`title`)
INNER JOIN `auto_subcategory` ON (`auto_type`.`subcategory_id` =
`auto_subcategory`.`title`) INNER JOIN `auto_client` T6 ON
(`auto_subcategory`.`client_id` = T6.`title`) INNER JOIN `auto_category`
T7 ON (`auto_subcategory`.`category_id` = T7.`title`) INNER JOIN
`auto_client` T8 ON (T7.`client_id` = T8.`title`) INNER JOIN
`auto_project` ON (`auto_type`.`project_id` = `auto_project`.`title`)
INNER JOIN `auto_client` T10 ON (`auto_project`.`client_id` = T10.`title`)
INNER JOIN `auto_category` T11 ON (`auto_project`.`category_id` =
T11.`title`) INNER JOIN `auto_client` T12 ON (T11.`client_id` =
T12.`title`) INNER JOIN `auto_subcategory` T13 ON
(`auto_project`.`subcategory_id` = T13.`title`) INNER JOIN `auto_client`
T14 ON (T13.`client_id` = T14.`title`) INNER JOIN `auto_category` T15 ON
(T13.`category_id` = T15.`title`) INNER JOIN `auto_client` T16 ON
(T15.`client_id` = T16.`title`) ORDER BY `auto_type`.`id` DESC

what do you mean by back-end?

python, django, centos6 64bit server, mysql

all works fine also on website + admin but only that part if I click each table 
in admin which are defined in admin.py 

  class ProjectAdmin(admin.ModelAdmin):


list_display = ('client', 'category', 'subcategory', 'title', )

admin.site.register(Project, ProjectAdmin)

the more I add FK's to list display and you click that PROJECT table or others 
the view of it in admin is making that query and takes so longif I make it 
just:

 class ProjectAdmin(admin.ModelAdmin):
list_display = ( 'title', )

admin.site.register(Project, ProjectAdmin)

NO FKs then it runs in 0.01ms

Screenshot: 

http://cl.ly/image/3w3D3g0h3h1A



On Wednesday, 26 September 2012 01:25:05 UTC-4, Jani Tiainen wrote:
>
> 26.9.2012 3:08, rentgeeen kirjoitti: 
> > I did that already, removed the field_to and make them as normal primary 
> > keys, 
> > 
> > the problem is when I put FK fields into "list_display" admin it still 
> > takes SQL 60 secs to process, if I remove them all is ok and App works 
> > great. 
> > 
> > so weird 
> > 
> > On Tuesday, 25 September 2012 02:01:17 UTC-4, Jani Tiainen wrote: 
> > 
> > Actually problem exists in your model. Unless this is legacy 
> database 
> > that you can't do anything about. 
> > 
> > Major performance killer is done by defining all your foreign key 
> > fields 
> > to be _strings_. Yes. "field_to" in model.ForeignKey() means that 
> this 
> > field uses "field_to" in related model as a key. And that being a 
> > string 
> > is major performance killer. 
> > 
> > Secondly your string fields are not indexed and using string as a 
> > foreign key is not efficient in both terms space and performance. 
> > 
> > If you don't specify one of your fields as primary key Django 
> creates 
> > one for you - called "id". If you don't specify "field_to" Django 
> uses 
> > primary key from your model in most of the cases that is "id", which 
> is 
> > integer. Indexed properly and so on. 
> > 
> > Try changing all your models to "correct" and remove "field_to" 
> > definitions from foreign keys. You should see quite a major speedup 
> > after rebuilding the database. 
> > 
> > 25.9.2012 2:17, rentgeeen kirjoitti: 
> >  > Have a SQL problem, adding this model all works correctly, the 
> > problem 
> >  > is in ADMIN. 
> >  > 
> >  > When I add the data just few to each table, by clicking on TYPE & 
> > PAGE 
> >  > in ADMIN the page is loading so slow, installed debug_toolbar and 
> > SQL 
> >  > took 17 seconds for the TYPE. When I tried the PAGE it gave me 
> > timeout, 
> >  > my question is what is wrong with my model? Is it constructed 
> bad? 
> >  > 
> >  > My goal is this lets say example: 
> >  > 

Re: A lots of foreign keys - Django Admin

2012-09-25 Thread Jani Tiainen

26.9.2012 3:08, rentgeeen kirjoitti:

I did that already, removed the field_to and make them as normal primary
keys,

the problem is when I put FK fields into "list_display" admin it still
takes SQL 60 secs to process, if I remove them all is ok and App works
great.

so weird

On Tuesday, 25 September 2012 02:01:17 UTC-4, Jani Tiainen wrote:

Actually problem exists in your model. Unless this is legacy database
that you can't do anything about.

Major performance killer is done by defining all your foreign key
fields
to be _strings_. Yes. "field_to" in model.ForeignKey() means that this
field uses "field_to" in related model as a key. And that being a
string
is major performance killer.

Secondly your string fields are not indexed and using string as a
foreign key is not efficient in both terms space and performance.

If you don't specify one of your fields as primary key Django creates
one for you - called "id". If you don't specify "field_to" Django uses
primary key from your model in most of the cases that is "id", which is
integer. Indexed properly and so on.

Try changing all your models to "correct" and remove "field_to"
definitions from foreign keys. You should see quite a major speedup
after rebuilding the database.

25.9.2012 2:17, rentgeeen kirjoitti:
 > Have a SQL problem, adding this model all works correctly, the
problem
 > is in ADMIN.
 >
 > When I add the data just few to each table, by clicking on TYPE &
PAGE
 > in ADMIN the page is loading so slow, installed debug_toolbar and
SQL
 > took 17 seconds for the TYPE. When I tried the PAGE it gave me
timeout,
 > my question is what is wrong with my model? Is it constructed bad?
 >
 > My goal is this lets say example:
 >
 > www.example.com/audi/4doors/s4/sport/red/audi-url

 >
 > basically all 6 urls are dynamic that I would specify in the each
table
 > and would be in the PAGE as dropdowns also in others. What is the
 > optimal way to do that or optimize the model?
 >
 > Here is a screenshot of TYPE page loading:
 >
 > screenshot: http://cl.ly/image/2931040E0t35

 >
 > Records:
 >
 > auto_client = 3 rows
 >
 > auto_category = 2 rows
 >
 > auto_subcategory = 2 rows
 >
 > auto_project = 5 rows
 >
 > auto_type = 2 rows
 >
 > auto_page = 0 - because cliking on auto_page it times out because
of SQL
 > query. Basically togehter like 14 records thats nothing :)
 >
 > here is also mysql query in PHPmyadmin: cl.ly/image/2S320h3d0P0J

 > > 17 seconds
 >
 > Please help thanks
 >
 >
 > |from  django.db import models
 >
 >
 > class Client(models.Model):
 >  title=  models.CharField(max_length=100,  unique=True)
 >  def __unicode__(self):
 >  return  self.title
 >
 > class Category(models.Model):
 >  client=  models.ForeignKey(Client,  to_field='title')
 >  title=  models.CharField(max_length=200,  unique=True)
 >  def __unicode__(self):
 >  return  self.title
 >
 > class Subcategory(models.Model):
 >  client=  models.ForeignKey(Client,  to_field='title')
 >  category=  models.ForeignKey(Category,  to_field='title')
 >  title=  models.CharField(max_length=200,  unique=True)
 >  def __unicode__(self):
 >  return  self.title
 >
 > class Project(models.Model):
 >  client=  models.ForeignKey(Client,  to_field='title')
 >  category=  models.ForeignKey(Category,  to_field='title')
 >  subcategory=  models.ForeignKey(Subcategory,  to_field='title')
 >  title=  models.CharField(max_length=200,  unique=True)
 >  def __unicode__(self):
 >  return  self.title
 >
 > class Type(models.Model):
 >  client=  models.ForeignKey(Client,  to_field='title')
 >  category=  models.ForeignKey(Category,  to_field='title')
 >  subcategory=  models.ForeignKey(Subcategory,  to_field='title')
 >  project=  models.ForeignKey(Project,  to_field='title')
 >  title=  models.CharField(max_length=200,  unique=True)
 >  def __unicode__(self):
 >  return  self.title
 >
 > class Page(models.Model):
 >  client=  models.ForeignKey(Client,  to_field='title')
 >  category=  models.ForeignKey(Category,  to_field='title')
 >  subcategory=  models.ForeignKey(Subcategory,  to_field='title')
 >  project=  models.ForeignKey(Project,  to_field='title')
 >  type=  models.ForeignKey(Type,  to_field='title')
 >  pageurl=  models.CharF

Re: Getting Started

2012-09-25 Thread Laxmikant Gurnalkar
Hi,
Extending to  Jani Tiainen--

 Or you have not properly installed Django, It looks like manage.py is
missing. In any of the version manage.py comes by default.
Use 7-zip   to unzip the django tarballs on windows machine.

regards,
Laxmikant



On Mon, Sep 24, 2012 at 9:37 PM, Greg Lindstrom wrote:

> Hello,
>
> I am having trouble getting started using Django 1.4.1 on my Windows 7
> machine.  Everything appears to be installed (I'm running Python 2.7 and
> have been programming in Python for over 10 years; I figure it's time to
> see what all the fuss is over "the web" :-).
>
> Reading through the tutorial on the Django page (the "polls" project), I
> start a new project using "django-admin.py startproject mysite".  It
> creates a new directory -- as promised -- but I'm in trouble, already!  My
> directory structure does not match the tutorial.  I expect:
>
> mysite/manage.py
> mysite/mysite/__init__.py
> mysite/mysite/manage.py
> mysite/mysite/settings.py
> mysite/mysite/urls.py
> mysite/mysite/wgsi.py
>
> and I get all of those.  But, I also get
>
> mysite/__init__.py
> mysite/setings.py
> mysite/urls.py
>
> giving me __init__.py, settings.py, and urls.py in both the "outter" and
> "inner" directories.  I'm I in the wrong tutorial?  The initital web server
> runs and I can edi the models.py file, but when I attempt the "python
> manage.py sql polls" command the settings file die snot know about "polls"
> (I added it to the applications).
>
> I'm eager to learn Django; can someone please give me a kick in the proper
> direction?
>
> --greg
> --
> 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/-/fkNOGLcwvpQJ.
> 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: Inheritance and default value

2012-09-25 Thread Laxmikant Gurnalkar
Hi winniehell,
  I think this will help you.
Dummy.__dict__.update({"myfield":42})

regards
--Laxmikant Gurnalkar


On Tue, Sep 25, 2012 at 4:17 PM, winniehell  wrote:

> Hello list!
>
> I try to overwrite a default value of a field in a subclass of an
> abstract model. This is how I do it currently:
> https://gist.github.com/3781124
>
> Is there any better way? As far as I know the _meta-class API is subject
> to change.
>
> Just to be clear about that: I can not move myfield out of the Base
> class as there are multiple classes inheriting from it.
>
> Best regards,
> Winnie
>
> --
> 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.
>
>


-- 
*

 GlxGuru

*

-- 
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: eCommerce Solutions

2012-09-25 Thread carlos
noup :( sorry only try use mezzanine cms!!

On Tue, Sep 25, 2012 at 7:30 PM, T.J. Simmons wrote:

> Thanks Carlos, I meant to include Cartridge in my list - potentially
> instead of Plata, actually. Do you have any experience with it?
>
> On Tue, Sep 25, 2012 at 4:38 PM, carlos  wrote:
>
>> Hi, maybe try with
>> http://mezzanine.jupo.org/ and http://cartridge.jupo.org/
>>
>> cheer,
>>
>>
>> On Tue, Sep 25, 2012 at 2:57 PM, T.J. Simmons 
>> wrote:
>>
>>> Hi all,
>>>
>>> I've got a store I need to get up and running in just over a month. I'm
>>> trying to pick an eCommerce solution but there just seems to be a lack of
>>> conversation (at least, that I've been able to find) regarding the
>>> different Django solutions. Do you guys have any experience with any of
>>> them? Any recommendations?
>>>
>>> The ones I've been looking at are Satchmo (which seems too much for what
>>> I need), LFS, Plata and Django Shop.
>>>
>>> Thanks!
>>> T.J.
>>>
>>> --
>>> 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/-/gaoqHUl5WWwJ.
>>> 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.
>>
>
>  --
> 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: eCommerce Solutions

2012-09-25 Thread T.J. Simmons
Thanks Carlos, I meant to include Cartridge in my list - potentially
instead of Plata, actually. Do you have any experience with it?

On Tue, Sep 25, 2012 at 4:38 PM, carlos  wrote:

> Hi, maybe try with
> http://mezzanine.jupo.org/ and http://cartridge.jupo.org/
>
> cheer,
>
>
> On Tue, Sep 25, 2012 at 2:57 PM, T.J. Simmons wrote:
>
>> Hi all,
>>
>> I've got a store I need to get up and running in just over a month. I'm
>> trying to pick an eCommerce solution but there just seems to be a lack of
>> conversation (at least, that I've been able to find) regarding the
>> different Django solutions. Do you guys have any experience with any of
>> them? Any recommendations?
>>
>> The ones I've been looking at are Satchmo (which seems too much for what
>> I need), LFS, Plata and Django Shop.
>>
>> Thanks!
>> T.J.
>>
>> --
>> 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/-/gaoqHUl5WWwJ.
>> 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.
>

-- 
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: A lots of foreign keys - Django Admin

2012-09-25 Thread rentgeeen
I did that already, removed the field_to and make them as normal primary 
keys,

the problem is when I put FK fields into "list_display" admin it still 
takes SQL 60 secs to process, if I remove them all is ok and App works 
great.

so weird

On Tuesday, 25 September 2012 02:01:17 UTC-4, Jani Tiainen wrote:
>
> Actually problem exists in your model. Unless this is legacy database 
> that you can't do anything about. 
>
> Major performance killer is done by defining all your foreign key fields 
> to be _strings_. Yes. "field_to" in model.ForeignKey() means that this 
> field uses "field_to" in related model as a key. And that being a string 
> is major performance killer. 
>
> Secondly your string fields are not indexed and using string as a 
> foreign key is not efficient in both terms space and performance. 
>
> If you don't specify one of your fields as primary key Django creates 
> one for you - called "id". If you don't specify "field_to" Django uses 
> primary key from your model in most of the cases that is "id", which is 
> integer. Indexed properly and so on. 
>
> Try changing all your models to "correct" and remove "field_to" 
> definitions from foreign keys. You should see quite a major speedup 
> after rebuilding the database. 
>
> 25.9.2012 2:17, rentgeeen kirjoitti: 
> > Have a SQL problem, adding this model all works correctly, the problem 
> > is in ADMIN. 
> > 
> > When I add the data just few to each table, by clicking on TYPE & PAGE 
> > in ADMIN the page is loading so slow, installed debug_toolbar and SQL 
> > took 17 seconds for the TYPE. When I tried the PAGE it gave me timeout, 
> > my question is what is wrong with my model? Is it constructed bad? 
> > 
> > My goal is this lets say example: 
> > 
> > www.example.com/audi/4doors/s4/sport/red/audi-url 
> > 
> > basically all 6 urls are dynamic that I would specify in the each table 
> > and would be in the PAGE as dropdowns also in others. What is the 
> > optimal way to do that or optimize the model? 
> > 
> > Here is a screenshot of TYPE page loading: 
> > 
> > screenshot: http://cl.ly/image/2931040E0t35 
> > 
> > Records: 
> > 
> > auto_client = 3 rows 
> > 
> > auto_category = 2 rows 
> > 
> > auto_subcategory = 2 rows 
> > 
> > auto_project = 5 rows 
> > 
> > auto_type = 2 rows 
> > 
> > auto_page = 0 - because cliking on auto_page it times out because of SQL 
> > query. Basically togehter like 14 records thats nothing :) 
> > 
> > here is also mysql query in PHPmyadmin: cl.ly/image/2S320h3d0P0J 
> >  17 seconds 
> > 
> > Please help thanks 
> > 
> > 
> > |from  django.db import models 
> > 
> > 
> > class Client(models.Model): 
> >  title=  models.CharField(max_length=100,  unique=True) 
> >  def __unicode__(self): 
> >  return  self.title 
> > 
> > class Category(models.Model): 
> >  client=  models.ForeignKey(Client,  to_field='title') 
> >  title=  models.CharField(max_length=200,  unique=True) 
> >  def __unicode__(self): 
> >  return  self.title 
> > 
> > class Subcategory(models.Model): 
> >  client=  models.ForeignKey(Client,  to_field='title') 
> >  category=  models.ForeignKey(Category,  to_field='title') 
> >  title=  models.CharField(max_length=200,  unique=True) 
> >  def __unicode__(self): 
> >  return  self.title 
> > 
> > class Project(models.Model): 
> >  client=  models.ForeignKey(Client,  to_field='title') 
> >  category=  models.ForeignKey(Category,  to_field='title') 
> >  subcategory=  models.ForeignKey(Subcategory,  to_field='title') 
> >  title=  models.CharField(max_length=200,  unique=True) 
> >  def __unicode__(self): 
> >  return  self.title 
> > 
> > class Type(models.Model): 
> >  client=  models.ForeignKey(Client,  to_field='title') 
> >  category=  models.ForeignKey(Category,  to_field='title') 
> >  subcategory=  models.ForeignKey(Subcategory,  to_field='title') 
> >  project=  models.ForeignKey(Project,  to_field='title') 
> >  title=  models.CharField(max_length=200,  unique=True) 
> >  def __unicode__(self): 
> >  return  self.title 
> > 
> > class Page(models.Model): 
> >  client=  models.ForeignKey(Client,  to_field='title') 
> >  category=  models.ForeignKey(Category,  to_field='title') 
> >  subcategory=  models.ForeignKey(Subcategory,  to_field='title') 
> >  project=  models.ForeignKey(Project,  to_field='title') 
> >  type=  models.ForeignKey(Type,  to_field='title') 
> >  pageurl=  models.CharField(max_length=200)| 
> > 
> > By cliking on TYPE this is the SQL output that takes 17 secs, cant click 
> on last PAGE because thats so long - timed out: 
> > 
> > |SELECT `auto_type`.`id`, `auto_type`.`client_id`, 
> > `auto_type`.`category_id`, `auto_type`.`subcategory_id`, 
> > `auto_type`.`project_id`, `auto_type`.`title`, `auto_client`.`id`, 
> > `auto_client`.`title`, `auto_category`.`id`, 
> `auto_category`.`client_

Re: django epydoc style documentation ?

2012-09-25 Thread Russell Keith-Magee
On Tue, Sep 25, 2012 at 5:16 PM, django_noob  wrote:
> Hi everyone,
>
> Is django documentation available in some other foramt, like epydoc or
> javadoc foramt anywhere?
> Django documentation is quite detailed, but I would prefer to have it
> different format, more api-like ?
>
> Just to be sure, in this kind of format:
> http://epydoc.sourceforge.net/api/
>
> Help appreciated

No - we don't currently have an website serving autogenerated API
docs. This is because auto generated API docs shouldn't generally be
required in Python, because the Python shell provides an interactive
way to access API documentation.

If you're on a vanilla Python shell, look into the help() command; if
you're on iPython, you can get the same result by appending ? to a
symbol name.

Yours,
Russ Magee %-)

-- 
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: eCommerce Solutions

2012-09-25 Thread carlos
Hi, maybe try with
http://mezzanine.jupo.org/ and http://cartridge.jupo.org/

cheer,

On Tue, Sep 25, 2012 at 2:57 PM, T.J. Simmons wrote:

> Hi all,
>
> I've got a store I need to get up and running in just over a month. I'm
> trying to pick an eCommerce solution but there just seems to be a lack of
> conversation (at least, that I've been able to find) regarding the
> different Django solutions. Do you guys have any experience with any of
> them? Any recommendations?
>
> The ones I've been looking at are Satchmo (which seems too much for what I
> need), LFS, Plata and Django Shop.
>
> Thanks!
> T.J.
>
> --
> 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/-/gaoqHUl5WWwJ.
> 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.



eCommerce Solutions

2012-09-25 Thread T.J. Simmons
Hi all,

I've got a store I need to get up and running in just over a month. I'm 
trying to pick an eCommerce solution but there just seems to be a lack of 
conversation (at least, that I've been able to find) regarding the 
different Django solutions. Do you guys have any experience with any of 
them? Any recommendations?

The ones I've been looking at are Satchmo (which seems too much for what I 
need), LFS, Plata and Django Shop.

Thanks!
T.J.

-- 
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/-/gaoqHUl5WWwJ.
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: [need advice and suggestion] questions about generating static web page.

2012-09-25 Thread Ezequiel
On Tuesday, September 25, 2012 3:11:45 PM UTC-3, bruce wrote:
>
> Dear All,
> I am a novice. 
> Currently, 
> I am thinking to build a simple static personal web page generator for the 
> people in my group. So, they can login my django powered site and input 
> their info, such as name, title, photo, education 
>

Bruce, take a look to http://nikola.ralsina.com.ar/

Ezequiel.
http;//flickrock.com/mikelpierre 

-- 
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/-/0xKyH-JIRIoJ.
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: questions about generating static web page.

2012-09-25 Thread bruce
Thanks very much!
Let me post the class in my models.py

so, in the models.py, there are three classes: person, section and item. 
a person has several sections. each section contains several items. 

class Person
   ..

class Section(models.Model):
person = models.ForeignKey(Person)
section_headings = models.CharField(blank=True,max_length=100)
..(also contains some fields for sorting and etc.)

  
class Item(models.Model):
section = models.ForeignKey(Section)
item_text = models.TextField()
...(also contains some fields for sorting and etc.)

The item is pretty simple. 
but if I am going to create a html table. what I can do. 
One way I can image is:
I am going to add a new class named Table. 

class Table(models.Model):
   section = models.ForeignKey(Section)

class Row(models.Model):
table = models.ForeignKey(Table).
..

class Cell(models.Model):
row = models.ForeignKey(Row)
.


Do you think is there any better way to do this? 

Thanks!!
Bruce

  



  





On Tuesday, September 25, 2012 4:15:25 PM UTC-4, ke1g wrote:
>
> I, and probably others, would need a more detailed description of 
> these tables and how they are to be used, before we could offer help 
> on them. 
>
> On Tue, Sep 25, 2012 at 3:22 PM, bruce > 
> wrote: 
> > Thanks!! 
> > Yes. This is exact what I did. 
> > Actually, I finish this in the admin template. 
> > But my question is: 
> > the template may contain some tables. 
> > These tables may have different number of rows and columns. 
> > 
> > 
> > so, in the model, 
> > there will be an additional class mytable. 
> > mytable should contain the number of rows and columns. mytable also 
> needs to 
> > contain the content to fill the table. 
> > is there an existing modules for the table? How can I implement to allow 
> the 
> > template show different size of tables. 
> > 
> > Thanks, 
> > Ming 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Tuesday, September 25, 2012 2:46:21 PM UTC-4, Amyth wrote: 
> >> 
> >> What do you mean by generating a Static HTML page for each user? 
> >> 
> >> From what i understand you can simply have a profile layout's html 
> >> template and use simple template tags to retrieve user data. 
> >> 
> >> For example: 
> >> 
> >> 1. Define a UserData class in your models.py that will basically store 
> all 
> >> the user data. 
> >> 2. Then in Views.py create a view that uses a username or user id to 
> get 
> >> data, something like this: 
> >> 
> >> #imports 
> >> from models import UserData 
> >> 
> >> 
> >> def user_profile(request, userid): 
> >>   userdata = UserData.objects.filter(userid=1) 
> >>   return render_to_response('profile.html', {'userdata': userdata}, 
> >> context_instance=RequestContext(request)) 
> >> 
> >> 3. You can use named groups to pass the userid to the view. Something 
> like 
> >> this, 
> >> 
> >> urlpatterns += patterns('', 
> >>   (r'^users/(?P.+?)/$', 'views.user_profile'), 
> >> ) 
> >> 
> >> 4. Then in the template you can use for loop template tag like 
> >> 
> >> {% if userdata %} 
> >>   userdata.username 
> >>
> >>  
> >> Example Field: 
> >> userdata.example_field 
> >>  
> >>
> >> {% endif %} 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> On Tue, Sep 25, 2012 at 11:44 PM, bruce  wrote: 
> >>> 
> >>> God. The original subject is too long. 
> >>> I made the Subject shorter. 
> >>> 
> >>> Thanks, 
> >>> Bruce 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote: 
>  
>  Dear All, 
>  
>  I am a novice. 
>  Currently, 
>  I am thinking to build a simple static personal web page generator 
> for 
>  the people in my group. So, they can login my django powered site and 
> input 
>  their info, such as name, title, photo, education background and etc. 
> Then, 
>  the person's static web page will be generated automatically. I know 
> I can 
>  use some advanced tools, such as DreamWeaver and frontpage editor, to 
> get it 
>  done. However, I prefer to use my freshly learned knowledge to build 
> a 
>  cms-like site to automatically generate the static web pages. 
>  
>  Currently, the site has been done. But I am stuck with a new problem. 
>  The static web page doesn't have HTML tables. 
>  For example, person A need a table(5 rows x 3 columns), person B 
> needs a 
>  table(2 rows x 2 columns). 
>  
>  do you have any suggestion? 
>  What kind of topic should I go to google? 
>  or, do you have any recommendation? django-cms? 
>  
>  Thanks All! 
>  Bruce 
>  
>  
>  
>  
>  
> >>> -- 
> >>> 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/-/r7or5qkzDaIJ. 
> >>> 
> >>> To post to this group, send ema

Re: django<-->twitter bootstrap philosophy

2012-09-25 Thread Vincent Fulco
Yes, thanks.  Templating remains the last piece of the puzzle I have yet to 
really work on and it wasn't clear how different it was from a framework.  
Appreciate your explanation.  V.

On Tuesday, September 25, 2012 11:40:36 AM UTC-5, azizmb.in wrote:
>
> I think you have confused things a little. Bootstrap is a CSS framework, 
> and makes it easy to *style* your pages, and includes a few javascript 
> libraries. Django on the other hand, is an MVC as you mentioned. Bootstrap 
> operates completely in the browser and handles only styling, and not 
> templating. You can definitely include the bootstrap library in your 
> templates, and use its classes to style your pages. 
> Example
> .
>
> I hope this clears your confusion.
>
> On Tue, Sep 25, 2012 at 8:58 PM, Vincent Fulco 
> > wrote:
>
>> Been thru the Django manual, bootstrap website instructions and other 
>> resources a few times so have working understanding of MVC structure.  
>> However, the incorporation of bootstrap throwing me off a little.  Working 
>> on a ecommerce idea, for now plan is to create homepage  (using bootstrap) 
>> as a launchpad to other pages (using bootstrap) providing services for two 
>> different target audiences (producers and consumers of service).  Once at 
>> the second site(?), this is where the MVC comes in for 
>> login/registration/EULA agreements/data io, etc.
>>
>> Is bootstrap considered to be substitute template for parts of the 
>> website then the django templating system takes up the rest?
>>
>> Any trailheads for these concepts would be much appreciated.
>>
>> TIA, V.
>>
>> -- 
>> 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/-/hRg6yZPq6QkJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> - Aziz M. Bookwala
>
> Website  | Twitter 
>  | Github 
>
>

-- 
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/-/np4Die6O-AwJ.
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: Step up to the plate

2012-09-25 Thread Alex Glaros
Two volunteers have stepped forward but need a little energy from the 
community to get the project going. Could you give them a hand?

more details: http://gov-ideas.com/startup-and-employment-program.htm

contact info: http://gov-ideas.com/contact.htm

thanks!

Alex

On Thursday, September 6, 2012 3:18:37 PM UTC-7, Alex Glaros wrote:
>
> *Dear Django Group,
>
> Can you spare a few lines of code?
>
> Our nonprofit has a great idea to help the unemployed and spur innovation 
> at the same time.
>
> All we need is a simple app to let users register.  
>
> Can I get a community effort from this great Django community to write the 
> registration app? 
>
> I’ll can do the data modeling, just a few tables, you only need to write 
> the CRUD for it.  Easy Peasy
>
> It would be great to get a few volunteers to help innovation and the 
> unemployed.
>
> App will be open source.  Detailed info below.  
>
> Thanks!
>
> Alex
>
>
> --
>
> EMPLOYMENT AND INNOVATION PROGRAM
>
> The nonprofit Center for Government Interoperability (CFGIO) is seeking 
> programming assistance for an employment and innovation program.* 
>
> *BACKGROUND
>
> 1. There are thousands of startup ideas that cannot be implemented due to 
> software developer costs
> 2. There are millions of unemployed, many of whom could learn programming 
> from free sources
>
> BASIC CONCEPT - Employment Program managed by CFGIO
>
> 1. Unemployed novice programmers learn from free sources and start writing 
> beginner apps in one year, and write moderately well after 2 years. College 
> students majoring in computer science/MIS would be ready immediately.
> 2. Unemployed novice programmers offer services to startups with simple 
> app or web-design requirements.
> 3. CFGIO sets up centralized database to match learning programmers with 
> startups, and creates processes to help them work effectively together.
> 4. Startups offer equity or delayed transaction-based payments to learning 
> programmers.
> 5. For startups, the purpose is to give them an affordable prototype that 
> allows investors to evaluate and fund production version of their idea. For 
> students, it gives them real-world learning experience and qualifies them 
> to apply for entry-level programming positions, or to start their own 
> startup.
>
> BENEFITS
>
> 1. Backlog of programmer positions that need filling is addressed
> 2. Unemployed become employable with high-paying future-proof skills. They 
> also learn project management and SDLC.
> 3. Startup ideas are enabled
> 4. Nationwide innovation is expanded
>
> IMPLEMENTATION – Request assistance from crowdsourced volunteers to:
>
> 1. Design curriculum – basically identify Youtube and other free training 
> materials (which now days are great) for each programming language
> 2. Mentor students
> 3. Create environment where students learn from each other
> 4. Design certification process
> 5. Design processes to enhance programmer/startup collaboration
>
> RESOURCES
>
> 1. Programming environments are cheap or free: 
> https://developers.google.com/appengine/docs/billing and 
> https://openshift.redhat.com/app/
> 2. Programming forums already provide assistance to newbies
>
> Any ideas or comments would be greatly appreciated,
>
> Alex Glaros
> Center for Government Interoperability
> www.gov-ideas.com
> Contact: http://gov-ideas.com/contact.htm* 
>

-- 
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/-/MX9OzWVKl3wJ.
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: questions about generating static web page.

2012-09-25 Thread Bill Freeman
I, and probably others, would need a more detailed description of
these tables and how they are to be used, before we could offer help
on them.

On Tue, Sep 25, 2012 at 3:22 PM, bruce  wrote:
> Thanks!!
> Yes. This is exact what I did.
> Actually, I finish this in the admin template.
> But my question is:
> the template may contain some tables.
> These tables may have different number of rows and columns.
>
>
> so, in the model,
> there will be an additional class mytable.
> mytable should contain the number of rows and columns. mytable also needs to
> contain the content to fill the table.
> is there an existing modules for the table? How can I implement to allow the
> template show different size of tables.
>
> Thanks,
> Ming
>
>
>
>
>
>
>
> On Tuesday, September 25, 2012 2:46:21 PM UTC-4, Amyth wrote:
>>
>> What do you mean by generating a Static HTML page for each user?
>>
>> From what i understand you can simply have a profile layout's html
>> template and use simple template tags to retrieve user data.
>>
>> For example:
>>
>> 1. Define a UserData class in your models.py that will basically store all
>> the user data.
>> 2. Then in Views.py create a view that uses a username or user id to get
>> data, something like this:
>>
>> #imports
>> from models import UserData
>>
>>
>> def user_profile(request, userid):
>>   userdata = UserData.objects.filter(userid=1)
>>   return render_to_response('profile.html', {'userdata': userdata},
>> context_instance=RequestContext(request))
>>
>> 3. You can use named groups to pass the userid to the view. Something like
>> this,
>>
>> urlpatterns += patterns('',
>>   (r'^users/(?P.+?)/$', 'views.user_profile'),
>> )
>>
>> 4. Then in the template you can use for loop template tag like
>>
>> {% if userdata %}
>>   userdata.username
>>   
>> 
>> Example Field:
>> userdata.example_field
>> 
>>   
>> {% endif %}
>>
>>
>>
>>
>>
>> On Tue, Sep 25, 2012 at 11:44 PM, bruce  wrote:
>>>
>>> God. The original subject is too long.
>>> I made the Subject shorter.
>>>
>>> Thanks,
>>> Bruce
>>>
>>>
>>>
>>>
>>>
>>> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:

 Dear All,

 I am a novice.
 Currently,
 I am thinking to build a simple static personal web page generator for
 the people in my group. So, they can login my django powered site and input
 their info, such as name, title, photo, education background and etc. Then,
 the person's static web page will be generated automatically. I know I can
 use some advanced tools, such as DreamWeaver and frontpage editor, to get 
 it
 done. However, I prefer to use my freshly learned knowledge to build a
 cms-like site to automatically generate the static web pages.

 Currently, the site has been done. But I am stuck with a new problem.
 The static web page doesn't have HTML tables.
 For example, person A need a table(5 rows x 3 columns), person B needs a
 table(2 rows x 2 columns).

 do you have any suggestion?
 What kind of topic should I go to google?
 or, do you have any recommendation? django-cms?

 Thanks All!
 Bruce





>>> --
>>> 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/-/r7or5qkzDaIJ.
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users...@googlegroups.com.
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>>
>> --
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras@gmail.com, ad...@techstricks.com
>>
>> Twitter - @mytharora
>> http://techstricks.com/
>
> --
> 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/-/JoXemRfP_f4J.
>
> 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: questions about generating static web page.

2012-09-25 Thread bruce
Thanks!!
Yes. This is exact what I did. 
Actually, I finish this in the admin template. 
But my question is:
the template may contain some tables. 
These tables may have different number of rows and columns. 


so, in the model, 
there will be an additional class mytable. 
mytable should contain the number of rows and columns. mytable also needs 
to contain the content to fill the table. 
is there an existing modules for the table? How can I implement to allow 
the template show different size of tables. 

Thanks,
Ming






On Tuesday, September 25, 2012 2:46:21 PM UTC-4, Amyth wrote:
>
> What do you mean by generating a Static HTML page for each user?
>
> From what i understand you can simply have a profile layout's html 
> template and use simple template tags to retrieve user data.
>
> For example:
>
> 1. Define a UserData class in your models.py that will basically store all 
> the user data.
> 2. Then in Views.py create a view that uses a username or user id to get 
> data, something like this:
>
> #imports
> from models import UserData
>
>
> def user_profile(request, userid):
>   userdata = UserData.objects.filter(userid=1)
>   return render_to_response('profile.html', {'userdata': userdata}, 
> context_instance=RequestContext(request))
>
> 3. You can use named 
> groups 
> to 
> pass the userid to the view. Something like this,
>
> urlpatterns += patterns('',
>   (r'^users/(?P.+?)/$', 'views.user_profile'),
> )
>
> 4. Then in the template you can use for loop template tag like
>
> {% if userdata %}
>   userdata.username
>   
> 
> Example Field:
> userdata.example_field
> 
>   
> {% endif %}
>
>
>
>
>
> On Tue, Sep 25, 2012 at 11:44 PM, bruce  >wrote:
>
>> God. The original subject is too long. 
>> I made the Subject shorter. 
>>
>> Thanks,
>> Bruce
>>
>>
>>
>>
>>
>> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:
>>>
>>> Dear All,
>>>
>>> I am a novice. 
>>> Currently, 
>>> I am thinking to build a simple static personal web page generator for 
>>> the people in my group. So, they can login my django powered site and input 
>>> their info, such as name, title, photo, education background and etc. Then, 
>>> the person's static web page will be generated automatically. I know I can 
>>> use some advanced tools, such as DreamWeaver and frontpage editor, to get 
>>> it done. However, I prefer to use my freshly learned knowledge to build a 
>>> cms-like site to automatically generate the static web pages. 
>>>
>>> Currently, the site has been done. But I am stuck with a new problem. 
>>> The static web page doesn't have HTML tables. 
>>> For example, person A need a table(5 rows x 3 columns), person B needs a 
>>> table(2 rows x 2 columns). 
>>>
>>> do you have any suggestion? 
>>> What kind of topic should I go to google? 
>>> or, do you have any recommendation? django-cms? 
>>>
>>> Thanks All!
>>> Bruce
>>>
>>>
>>>
>>>
>>>
>>>  -- 
>> 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/-/r7or5qkzDaIJ.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras@gmail.com , ad...@techstricks.com
> Twitter - @mytharora
> http://techstricks.com/
>  

-- 
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/-/JoXemRfP_f4J.
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: sqlite datetime issue with django

2012-09-25 Thread Bill Freeman
When django reads the data back, does it reconvert it to your
timezone?  If so, why is it a problem that it is stored as UTC in the
database?

On Tue, Sep 25, 2012 at 2:19 PM, puneet loya  wrote:
> Hi,
>
> I m having problems with sqlite insertion.
>
> When i enter datetime object using django into sqlite, sqlite is converting
> the datetime to UTC and storing it. Hence the datetime inserted in the
> sqlite db is incorrect.
>
> My timezone in UTC+05:30 and the datetime inserted is in UTC.
>
>
> Any suggestions??
>
> --
> 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/-/98E6x3lnvtwJ.
> 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: questions about generating static web page.

2012-09-25 Thread Bill Freeman
It sounds a bit like you want a profile app.  It's model holds those
things beyond what is already in auth User, which could include one or
more text fields, perhaps using TinyMCE or markdown.  There is
plumbing in Django whereby if you specify such a model in settings.py
it will get attached OneToOne to the User instance, and both provide
means for getting from one to the other.  You can create custom views
to, for example, list users by name, with office and phone columns,
assuming that you defined such fields in the Profile model.  See:

  
https://docs.djangoproject.com/en/1.4/topics/auth/#storing-additional-information-about-users

On Tue, Sep 25, 2012 at 2:48 PM, Amyth Arora  wrote:
> sorry, changeuserdata = UserData.objects.filter(userid=1)  to
> userdata = UserData.objects.filter(id=userid)
>
>
> On Wed, Sep 26, 2012 at 12:15 AM, Amyth Arora 
> wrote:
>>
>> What do you mean by generating a Static HTML page for each user?
>>
>> From what i understand you can simply have a profile layout's html
>> template and use simple template tags to retrieve user data.
>>
>> For example:
>>
>> 1. Define a UserData class in your models.py that will basically store all
>> the user data.
>> 2. Then in Views.py create a view that uses a username or user id to get
>> data, something like this:
>>
>> #imports
>> from models import UserData
>>
>>
>> def user_profile(request, userid):
>>   userdata = UserData.objects.filter(userid=1)
>>   return render_to_response('profile.html', {'userdata': userdata},
>> context_instance=RequestContext(request))
>>
>> 3. You can use named groups to pass the userid to the view. Something like
>> this,
>>
>> urlpatterns += patterns('',
>>   (r'^users/(?P.+?)/$', 'views.user_profile'),
>> )
>>
>> 4. Then in the template you can use for loop template tag like
>>
>> {% if userdata %}
>>   userdata.username
>>   
>> 
>> Example Field:
>> userdata.example_field
>> 
>>   
>> {% endif %}
>>
>>
>>
>>
>>
>> On Tue, Sep 25, 2012 at 11:44 PM, bruce  wrote:
>>>
>>> God. The original subject is too long.
>>> I made the Subject shorter.
>>>
>>> Thanks,
>>> Bruce
>>>
>>>
>>>
>>>
>>>
>>> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:

 Dear All,

 I am a novice.
 Currently,
 I am thinking to build a simple static personal web page generator for
 the people in my group. So, they can login my django powered site and input
 their info, such as name, title, photo, education background and etc. Then,
 the person's static web page will be generated automatically. I know I can
 use some advanced tools, such as DreamWeaver and frontpage editor, to get 
 it
 done. However, I prefer to use my freshly learned knowledge to build a
 cms-like site to automatically generate the static web pages.

 Currently, the site has been done. But I am stuck with a new problem.
 The static web page doesn't have HTML tables.
 For example, person A need a table(5 rows x 3 columns), person B needs a
 table(2 rows x 2 columns).

 do you have any suggestion?
 What kind of topic should I go to google?
 or, do you have any recommendation? django-cms?

 Thanks All!
 Bruce





>>> --
>>> 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/-/r7or5qkzDaIJ.
>>>
>>> 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.
>>
>>
>>
>>
>> --
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras.offic...@gmail.com, ad...@techstricks.com
>> Twitter - @mytharora
>> http://techstricks.com/
>
>
>
>
> --
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras.offic...@gmail.com, ad...@techstricks.com
> Twitter - @mytharora
> http://techstricks.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: questions about generating static web page.

2012-09-25 Thread Amyth Arora
sorry, changeuserdata = UserData.objects.filter(userid=1)  to
userdata = UserData.objects.filter(id=userid)

On Wed, Sep 26, 2012 at 12:15 AM, Amyth Arora wrote:

> What do you mean by generating a Static HTML page for each user?
>
> From what i understand you can simply have a profile layout's html
> template and use simple template tags to retrieve user data.
>
> For example:
>
> 1. Define a UserData class in your models.py that will basically store all
> the user data.
> 2. Then in Views.py create a view that uses a username or user id to get
> data, something like this:
>
> #imports
> from models import UserData
>
>
> def user_profile(request, userid):
>   userdata = UserData.objects.filter(userid=1)
>   return render_to_response('profile.html', {'userdata': userdata},
> context_instance=RequestContext(request))
>
> 3. You can use named 
> groups 
> to
> pass the userid to the view. Something like this,
>
> urlpatterns += patterns('',
>   (r'^users/(?P.+?)/$', 'views.user_profile'),
> )
>
> 4. Then in the template you can use for loop template tag like
>
> {% if userdata %}
>   userdata.username
>   
> 
> Example Field:
> userdata.example_field
> 
>   
> {% endif %}
>
>
>
>
>
> On Tue, Sep 25, 2012 at 11:44 PM, bruce  wrote:
>
>> God. The original subject is too long.
>> I made the Subject shorter.
>>
>> Thanks,
>> Bruce
>>
>>
>>
>>
>>
>> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:
>>>
>>> Dear All,
>>>
>>> I am a novice.
>>> Currently,
>>> I am thinking to build a simple static personal web page generator for
>>> the people in my group. So, they can login my django powered site and input
>>> their info, such as name, title, photo, education background and etc. Then,
>>> the person's static web page will be generated automatically. I know I can
>>> use some advanced tools, such as DreamWeaver and frontpage editor, to get
>>> it done. However, I prefer to use my freshly learned knowledge to build a
>>> cms-like site to automatically generate the static web pages.
>>>
>>> Currently, the site has been done. But I am stuck with a new problem.
>>> The static web page doesn't have HTML tables.
>>> For example, person A need a table(5 rows x 3 columns), person B needs a
>>> table(2 rows x 2 columns).
>>>
>>> do you have any suggestion?
>>> What kind of topic should I go to google?
>>> or, do you have any recommendation? django-cms?
>>>
>>> Thanks All!
>>> Bruce
>>>
>>>
>>>
>>>
>>>
>>>  --
>> 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/-/r7or5qkzDaIJ.
>>
>> 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.
>>
>
>
>
> --
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras.offic...@gmail.com, ad...@techstricks.com
> Twitter - @mytharora
> http://techstricks.com/
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @mytharora
http://techstricks.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: questions about generating static web page.

2012-09-25 Thread Amyth Arora
What do you mean by generating a Static HTML page for each user?

>From what i understand you can simply have a profile layout's html template
and use simple template tags to retrieve user data.

For example:

1. Define a UserData class in your models.py that will basically store all
the user data.
2. Then in Views.py create a view that uses a username or user id to get
data, something like this:

#imports
from models import UserData


def user_profile(request, userid):
  userdata = UserData.objects.filter(userid=1)
  return render_to_response('profile.html', {'userdata': userdata},
context_instance=RequestContext(request))

3. You can use named
groups
to
pass the userid to the view. Something like this,

urlpatterns += patterns('',
  (r'^users/(?P.+?)/$', 'views.user_profile'),
)

4. Then in the template you can use for loop template tag like

{% if userdata %}
  userdata.username
  

Example Field:
userdata.example_field

  
{% endif %}





On Tue, Sep 25, 2012 at 11:44 PM, bruce  wrote:

> God. The original subject is too long.
> I made the Subject shorter.
>
> Thanks,
> Bruce
>
>
>
>
>
> On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:
>>
>> Dear All,
>>
>> I am a novice.
>> Currently,
>> I am thinking to build a simple static personal web page generator for
>> the people in my group. So, they can login my django powered site and input
>> their info, such as name, title, photo, education background and etc. Then,
>> the person's static web page will be generated automatically. I know I can
>> use some advanced tools, such as DreamWeaver and frontpage editor, to get
>> it done. However, I prefer to use my freshly learned knowledge to build a
>> cms-like site to automatically generate the static web pages.
>>
>> Currently, the site has been done. But I am stuck with a new problem. The
>> static web page doesn't have HTML tables.
>> For example, person A need a table(5 rows x 3 columns), person B needs a
>> table(2 rows x 2 columns).
>>
>> do you have any suggestion?
>> What kind of topic should I go to google?
>> or, do you have any recommendation? django-cms?
>>
>> Thanks All!
>> Bruce
>>
>>
>>
>>
>>
>>  --
> 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/-/r7or5qkzDaIJ.
>
> 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.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @mytharora
http://techstricks.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: Django on Bluehost

2012-09-25 Thread Gladson Simplício Brito
https://www.appfog.com/

2012/9/24 Babatunde Akinyanmi 

> If cloud, I like dotcloud
>
> On 9/24/12, Alec Taylor  wrote:
> > You will probably crap-out with Bitbucket. Go to a cloud provider
> instead.
> >
> > For example, Red Hat OpenShift offers their IaaS platform for free (ATM
> > anyway).
> >
> > On Mon, Sep 24, 2012 at 2:21 PM, Zach  wrote:
> >
> >> Hey everyone,
> >> I have recently been setting up a Django 1.4.1 project with python 2.7.2
> >> and MySQL. I am using fcgi to deploy my project in this environment
> >> because
> >> mod_wsgi is not available through bluehost. After much frustration I
> have
> >> gotten my site up to display the "it works" page. Now for some strange
> >> reason I can not get it away from this page. I have set up the urls.py
> >> file
> >> for the main project along with adding my app into the Installed_Apps
> >> section of the settings.py file.
> >> My .htaccess file is the following
> >> *AddHandler fcgid-script .fcgi*
> >> *Options +SymLinksIfOwnerMatch*
> >> *RewriteEngine On*
> >> *RewriteBase /*
> >> *RewriteRule ^(media/.*)$ - [L]*
> >> *RewriteRule ^(adminmedia/.*)$ - [L]*
> >> *RewriteCond %{REQUEST_URI} !(mysite.fcgi)*
> >> *RewriteRule ^(.*)$ mysite.fcgi/$1 [L]*
> >>
> >> My mysite.fcgi is the following
> >> *#!/home1/propesn4/python27/bin/python*
> >> *import sys, os*
> >> *sys.path.insert(0, "/home1/propesn4/python27")*
> >> *os.environ['DJANGO_SETTINGS_MODULE'] = "project.settings"
> >> *
> >> *sys.path.append("/home1/propesn4/project/")*
> >> *from django.core.servers.fastcgi import runfastcgi*
> >> *runfastcgi(method="threaded", daemonize="false")*
> >> *
> >> *
> >> When I make changes to my django project I preform a *touch mysite.fcgi*
> >> so
> >> that the fcgi agent knows there has been changes.
> >> If anyone could lead me in the right direction I would really appreciate
> >> it!
> >>
> >>  --
> >> 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/-/Aqyku-yyimsJ.
> >> 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.
> >
> >
>
> --
> Sent from my mobile device
>
> --
> 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.



sqlite datetime issue with django

2012-09-25 Thread puneet loya
Hi,

I m having problems with sqlite insertion.

When i enter datetime object using django into sqlite, sqlite is converting 
the datetime to UTC and storing it. Hence the datetime inserted in the 
sqlite db is incorrect.

My timezone in UTC+05:30 and the datetime inserted is in UTC.


Any suggestions??

-- 
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/-/98E6x3lnvtwJ.
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.



questions about generating static web page.

2012-09-25 Thread bruce
God. The original subject is too long. 
I made the Subject shorter. 

Thanks,
Bruce




On Tuesday, September 25, 2012 2:11:45 PM UTC-4, bruce wrote:
>
> Dear All,
>
> I am a novice. 
> Currently, 
> I am thinking to build a simple static personal web page generator for the 
> people in my group. So, they can login my django powered site and input 
> their info, such as name, title, photo, education background and etc. Then, 
> the person's static web page will be generated automatically. I know I can 
> use some advanced tools, such as DreamWeaver and frontpage editor, to get 
> it done. However, I prefer to use my freshly learned knowledge to build a 
> cms-like site to automatically generate the static web pages. 
>
> Currently, the site has been done. But I am stuck with a new problem. The 
> static web page doesn't have HTML tables. 
> For example, person A need a table(5 rows x 3 columns), person B needs a 
> table(2 rows x 2 columns). 
>
> do you have any suggestion? 
> What kind of topic should I go to google? 
> or, do you have any recommendation? django-cms? 
>
> Thanks All!
> Bruce
>
>
>
>
>
>

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



[need advice and suggestion] questions about generating static web page.

2012-09-25 Thread bruce
Dear All,

I am a novice. 
Currently, 
I am thinking to build a simple static personal web page generator for the 
people in my group. So, they can login my django powered site and input 
their info, such as name, title, photo, education background and etc. Then, 
the person's static web page will be generated automatically. I know I can 
use some advanced tools, such as DreamWeaver and frontpage editor, to get 
it done. However, I prefer to use my freshly learned knowledge to build a 
cms-like site to automatically generate the static web pages. 

Currently, the site has been done. But I am stuck with a new problem. The 
static web page doesn't have HTML tables. 
For example, person A need a table(5 rows x 3 columns), person B needs a 
table(2 rows x 2 columns). 

do you have any suggestion? 
What kind of topic should I go to google? 
or, do you have any recommendation? django-cms? 

Thanks All!
Bruce





-- 
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/-/i4S-nK72vP0J.
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 on _strptime_time

2012-09-25 Thread Victor
MadeR did you ever get to the bottom of this error? I am using python2.6.5, 
django1.3.1, and tastypie0.9.7 with a mysql5.1 back end. Its a real doozy, 
I have never seen it when developing locally, but once a week or so I'll 
get an email from my production django server that has something like this 
in it:
Traceback (most recent call last):

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
 
line 175, in wrapper
response = callback(request, *args, **kwargs)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
 
line 334, in dispatch_list
return self.dispatch('list', request, **kwargs)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
 
line 364, in dispatch
response = method(request, **kwargs)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
 
line 934, in get_list
objects = self.obj_get_list(request=request, 
**self.remove_api_resource_names(kwargs))

  File 
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/api.py",
 
line 178, in obj_get_list
return self.get_object_list(request)

  File 
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/api.py",
 
line 339, in get_object_list
return get_weekly_winner_row_list(min_date=min_date, max_date=max_date)

  File 
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/leaderboard_builder.py",
 
line 145, in get_weekly_winner_row_list
weeks = _build_query(weeks, min_date, max_date)

  File 
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/leaderboard_builder.py",
 
line 135, in _build_query
initial_objects = initial_objects.filter(victory_date__gte=min_date)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/manager.py",
 
line 141, in filter
return self.get_query_set().filter(*args, **kwargs)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/query.py",
 
line 550, in filter
return self._filter_or_exclude(False, *args, **kwargs)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/query.py",
 
line 568, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/query.py",
 
line 1172, in add_q
can_reuse=used_aliases, force_having=force_having)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/query.py",
 
line 1107, in add_filter
connector)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/where.py",
 
line 67, in add
value = obj.prepare(lookup_type, value)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/where.py",
 
line 316, in prepare
return self.field.get_prep_lookup(lookup_type, value)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
 
line 644, in get_prep_lookup
return super(DateField, self).get_prep_lookup(lookup_type, value)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
 
line 292, in get_prep_lookup
return self.get_prep_value(value)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
 
line 721, in get_prep_value
return self.to_python(value)

  File 
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
 
line 698, in to_python
return datetime.datetime(*time.strptime(value, '%Y-%m-%d %H:%M:%S')[:6],

AttributeError: _strptime_time

Any pointers you might have for me would be greatly appreciated.

On Thursday, March 10, 2011 12:03:31 PM UTC-5, MadeR wrote:
>
> The error  was trapped by django-sentry and does *not* occur in python
> interpreter, thus I can't understand it!
> Please can anybody enlighten me?
>
> Here the details:
>
> Exception Type: AttributeError
> Exception Value: _strptime_time
>
> The error is raised by line #698 in
>
> /usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/fields/__init__.py
> in to_python using django 1.2.5:
>
>  698. return datetime.datetime(*time.strptime(value, '%Y-%m-%d
> %H:%M:%S')[:6],
>  699. **kwargs)
>
> With local variables:
>
> kwargs = {'microsecond': 0}
> self = u''
> usecs = 0
> value = u'2011-02-24 00:00:00'
>
>

-- 
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/-/u0xnSVyhzdsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@google

Re: content management in django

2012-09-25 Thread Paul Backhouse
On Tue, 2012-09-25 at 06:35 -0700, eclypcix wrote:
> What I should have asked, is it okay to store all the site's html
> content in a database? Is it usually done that way?
> 

I'm not sure what you mean by "all the site's html". You wouldn't have
_all_ the sites html in the database, django generates html dynamically
in response to requests, and (usually html) templates are used to
provide uniform structure around the context of a response. Templates
are not normally stored in a database, maybe because they're not
considered to be data which are likely to change, nor can be expressed
in a relational manner.

However it's not unreasonable to have some editable content stored in
the database, which may be html.

An example:

A site has an "About Us" page and the client wants to add in the fact
that Gerald has joined the company.

You could render a template that has all the "About Us" data hard coded,
but then to update the page you would have to edit the template, check
it into revision control and redeploy the site.

If you use flatpages (or any other CMS) then the site administrator (the
client) can change the "About Us" page content through the admin
interface, save it (to the database) and make sure it looks OK on the
site. Lovely.

-- 
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<-->twitter bootstrap philosophy

2012-09-25 Thread azizmb.in
I think you have confused things a little. Bootstrap is a CSS framework,
and makes it easy to *style* your pages, and includes a few javascript
libraries. Django on the other hand, is an MVC as you mentioned. Bootstrap
operates completely in the browser and handles only styling, and not
templating. You can definitely include the bootstrap library in your
templates, and use its classes to style your pages.
Example
.

I hope this clears your confusion.

On Tue, Sep 25, 2012 at 8:58 PM, Vincent Fulco  wrote:

> Been thru the Django manual, bootstrap website instructions and other
> resources a few times so have working understanding of MVC structure.
> However, the incorporation of bootstrap throwing me off a little.  Working
> on a ecommerce idea, for now plan is to create homepage  (using bootstrap)
> as a launchpad to other pages (using bootstrap) providing services for two
> different target audiences (producers and consumers of service).  Once at
> the second site(?), this is where the MVC comes in for
> login/registration/EULA agreements/data io, etc.
>
> Is bootstrap considered to be substitute template for parts of the website
> then the django templating system takes up the rest?
>
> Any trailheads for these concepts would be much appreciated.
>
> TIA, V.
>
> --
> 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/-/hRg6yZPq6QkJ.
> 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.
>



-- 
- Aziz M. Bookwala

Website  | Twitter  |
Github 

-- 
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: What's the best way to save generated images?

2012-09-25 Thread JC Briar
Okay, this may not be the most efficient implementation, but it works:

  # create temporary file
  tmpfile = tempfile.TemporaryFile()
  *write to tmpfile*

  # wrap temporary file with django.core.files.File
  fileContents = django.core.files.File(tmpfile)
  fileContents.size = tmpfile.tell()  # admittedly, a bit of a hack
  
  # create and save new Model
  model = Chart(**kwargs)
  model.image.save(fn, fileContents)

-- 
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/-/ve5L7uRErOIJ.
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 Eclipse showed "Undefined Variable"

2012-09-25 Thread Maysxuan
Thank all of you , and the answers are all correct .
 
I choosed "I believe this is what you actually want to do: 
'zxfca.views.hello' instead of zxfca.views.hello" .

On Tuesday, September 25, 2012 11:10:42 PM UTC+8, Maysxuan wrote:

> *I am new to Python & Django ,and I created a test project for Django in 
> Eclipse ,then got a "Undefined Variable".*
> ** 
> *And who would tell me what happened?*
> ** 
> *(Attachment is the screenshot)*
> ** 
> ** 
>  
>
>  
>

-- 
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/-/v5Rcl9oSYqAJ.
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<-->twitter bootstrap philosophy

2012-09-25 Thread Vincent Fulco
Been thru the Django manual, bootstrap website instructions and other 
resources a few times so have working understanding of MVC structure.  
However, the incorporation of bootstrap throwing me off a little.  Working 
on a ecommerce idea, for now plan is to create homepage  (using bootstrap) 
as a launchpad to other pages (using bootstrap) providing services for two 
different target audiences (producers and consumers of service).  Once at 
the second site(?), this is where the MVC comes in for 
login/registration/EULA agreements/data io, etc.

Is bootstrap considered to be substitute template for parts of the website 
then the django templating system takes up the rest?

Any trailheads for these concepts would be much appreciated.

TIA, V.

-- 
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/-/hRg6yZPq6QkJ.
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 Eclipse showed "Undefined Variable"

2012-09-25 Thread Luiz A. Menezes Filho
Because there's no variable called zxfca.
I believe this is what you actually want to do: 'zxfca.views.hello' instead
of zxfca.views.hello

Att,

On Tue, Sep 25, 2012 at 12:10 PM, Maysxuan  wrote:

> *I am new to Python & Django ,and I created a test project for Django in
> Eclipse ,then got a "Undefined Variable".*
> **
> *And who would tell me what happened?*
> **
> *(Attachment is the screenshot)*
> **
> **
>
>
>
>
> --
> 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/-/eWFg1qgyma0J.
> 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.
>



-- 
Luiz Menezes

-- 
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: why Eclipse showed "Undefined Variable"

2012-09-25 Thread Paul Backhouse
On Tue, 2012-09-25 at 08:10 -0700, Maysxuan wrote:
> I am new to Python & Django ,and I created a test project for Django
> in Eclipse ,then got a "Undefined Variable".
>  
> And who would tell me what happened?
>  
> (Attachment is the screenshot)
>  

You've imported "hello" from "zxcfa.views". So try changing
"zxcfa.views.hello" to just "hello".


-- 
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: save() got an unexpected keyword argument 'force_insert'

2012-09-25 Thread Dan Gentry
To address the original question, I saw a similar error when overriding the 
save() function of a model.  The solution was to include *args and **kwargs 
in the function definition:

def save(self,*args, **kwargs):
# your custom code here #
super(MyModel, self).save(*args, **kwargs)


>

-- 
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/-/vYCgvZ74BEQJ.
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: Using email instead of username for registration and login

2012-09-25 Thread Tom Christie
This should cover it:

  https://github.com/dabapps/django-email-as-username

For compatibility with django-registration you'll also want to take a look 
at the thread on this ticket:

  https://github.com/dabapps/django-email-as-username/issues/17

Cheers,

  Tom

On Tuesday, 25 September 2012 02:57:20 UTC+1, Bill Beal wrote:
>
> Hi all,
>
> I want to use the email address as the username for registration and 
> login.  I'm using django-registration for 2-stage registration.  I'm 
> looking for an easier way than what I've come up with so far.  I can modify 
> registration and activation, but then django.contrib.auth.views.login has a 
> 30-character limit on the username.  I'm not looking forward to making 
> username act like an email address.  Any quick fixes?
>

-- 
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/-/pm-WyxpvirMJ.
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 project and SVN loads older code versions

2012-09-25 Thread Joris
The reason why you are seeing this behaviour is because apache caches the 
compiled python scripts. As apache has multiple threads, some still carry 
old information, and some new. As HTTP is stateless, this is why you get 
inconsistent behaviour. The situation is resolved by either reloading 
apache or by using the testing server. The behaviour you describe cannot be 
a result of SVN, as SVN is not affected upon refresh. 

jb

Op dinsdag 25 september 2012 14:19:04 UTC+2 schreef Leo het volgende:
>
> Let me understand: you commit code to a SVN repository and put in in 
> production? Did you restart Apache?
>
> Leo
>
> 2012/9/25 Gjorge Karakabakov >
>
>> I can't explain it but Django + SVN for code version control loads older 
>> buggy versions of files every time i hit refresh on the web site i'm 
>> working on.
>>
>> So if I changed something in a file 2 days ago (made lots of commits 
>> since then) it will show up now. Next time I hit refresh another change 1 
>> day ago appears.
>>
>> I'm using: Django 1.4, Apache, SVN
>>  -- 
>> 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/-/4UNbERN1NxoJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> Leonardo Giordani
>
>

-- 
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/-/_VNa1jNVVDEJ.
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: Can I simply disable the CSRF? crazy

2012-09-25 Thread puneet loya
Thank you all for your suggestions :) :)

On Mon, Sep 24, 2012 at 7:56 PM, Nicolas Patry wrote:

> If you are access to the form (meaning you are in the dom), and if you
> don't mind using jQuery, there is the even simpler:
>
> 
>> $.post("/some/url", $("#someform").serialize(), function(data){
>>   // Do whatever with data
>> })
>
>
> $("#someform").serialize() automatically adds the crsf_token which should
> be contained in your form. This makes a lot easier to validate your form
> via AJAX.
>
> Cheers,
> Nicolas Patry
>
> On Monday, September 24, 2012 4:00:02 PM UTC+2, jondykeman wrote:
>>
>> +1 For doing it right from the beginning.
>>
>> I was tempted to disable when trying to deal with AJAX especially early
>> on. Below is some code with jQuery so that you won't need to manually feed
>> the token through your AJAX.
>>
>>