Re: Missing files on a new project

2013-01-27 Thread Pankaj Singh
Hey,

Django-book has not been updated for a long time and tutorials you went
through are based on Django 1.0

In Django 1.4, settings.py, urls.py and other project related files are
located under a directory with project name.

In you case if you look into demo/ folder, you will see urls.py and
setting.py.

On Monday, January 28, 2013, Ricardo Diaz wrote:

> Hi, I'm pretty noob with Django.
>
> I've readed a few pages of the Django-book and just started to create my
> own projects.
>
> When I try to create a new project using django-admin startproject demo,
> it just creates 2 things
>
> project
>   l--demo
>   l--manage.py
>
> I don't know why it doesn't create the missing files: __init__.py
> settings.py and urls.py
>
> I'm working on Ubuntu 12.04 and this happens on Django 1.4.3 and 1.4
> versions
>
> Thx for your help.
>
> --
> 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 'django-users@googlegroups.com');>
> .
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com  'django-users%2bunsubscr...@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
--
Pankaj Singh
http://about.me/psjinx

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




Re: How Django sends push notifications.

2013-01-27 Thread Pankaj Singh
On 00:39 -0500 / 28 Jan, Chen Xu wrote:
> I am recently building a web service for my iphone app, just wondering if
> Django can send push notifications to iPhone.
Django has no in-built feature for this, however, you can use 3rd party python 
libraries for this.

Please have a look at this blog post - 
http://highonpython.com/index.php/setting-up-ios-push-notifications-apns-with-pythondjango-through-pyapns/

--
Pankaj

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: initial argument in forms not working for me

2013-01-27 Thread Nikhil Verma
Sorry I made a typo in last email .

Can anybody explain what mistake i am  doing ?

Hi

I am using django 1.4.3 and have a field in form


 PROFILE_TYPE = (
('public', 'Public'),
('private', 'Private'),
)
 profile_type = forms.CharField(max_length=10, widget=RadioSelect

>
>  (choices=PROFILE_TYPE),
>initial='Public',
>required=False
>)
>

Thanks



On Mon, Jan 28, 2013 at 11:05 AM, Nikhil Verma wrote:

> Hi
>
> I am using django 1.4.3 and have a field in form
>
>
>  PROFILE_TYPE = (
> ('public', 'Public'),
> ('private', 'Private'),
> )
>  profile_type = forms.CharField(max_length=10, widget=RadioSelect
>(choices=PROFILE_TYPE),
>initial='Public',
>required=False
>)
>
> I want that when i open this form the radio button with choice public
> should be pre selected.
> Can anybody explain what mistake you are doing ?
>
> Thanks
>
>
> --
> Regards
> Nikhil Verma
> +91-958-273-3156
>



-- 
Regards
Nikhil Verma
+91-958-273-3156

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




Missing files on a new project

2013-01-27 Thread Ricardo Diaz
Hi, I'm pretty noob with Django.

I've readed a few pages of the Django-book and just started to create my 
own projects.

When I try to create a new project using django-admin startproject demo, it 
just creates 2 things

project
  l--demo
  l--manage.py

I don't know why it doesn't create the missing files: __init__.py 
settings.py and urls.py

I'm working on Ubuntu 12.04 and this happens on Django 1.4.3 and 1.4 
versions

Thx for your help.

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




Re: PHP vs Django

2013-01-27 Thread Edwin Lunando
Although, your question is out of topic, let me share my experience. Most 
of the times, framework skill is only a plus in your resume. Your algorithm 
skill, application design, and analysis is the major component that will 
determine that you will be hired or not(if you apply as a software 
engineer). You will undergo several interview including technical interview 
after applying to one of the companies you've listed. 

On Monday, January 28, 2013 10:54:21 AM UTC+7, Vijaya Reddy wrote:
>
> Is it possible to get job in companies like Google,Amazon,Cisco,.
>
>
> On Sun, Jan 27, 2013 at 7:50 PM, Nikhil Verma 
>  > wrote:
>
>> Well i would say  its all about money and passion for programming.In Web 
>> development you are uncertain which you have to learn next.
>>
>> My personnel opinion:-
>>
>> php is a crap. Its a horrible language.
>>
>> Python well i would say the king of all and the framework Django is 
>> amazing.
>>
>> Thanks
>>
>>
>>
>> On Mon, Jan 28, 2013 at 9:10 AM, Londerson Araújo 
>> > > wrote:
>>
>>> Man, i work with PHP for 5 years more or less, and Python is the 
>>> the answer for my life. 
>>>
>>> -- 
>>> 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?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>>
>>
>> -- 
>> Regards
>> Nikhil Verma
>> +91-958-273-3156
>>
>>  -- 
>> 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?hl=en.
>> 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 post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How Django sends push notifications.

2013-01-27 Thread Chen Xu
Hi, Django users,
I am recently building a web service for my iphone app, just wondering if
Django can send push notifications to iPhone.

Thanks


-- 
⚡ Chen Xu ⚡

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




initial argument in forms not working for me

2013-01-27 Thread Nikhil Verma
Hi

I am using django 1.4.3 and have a field in form


 PROFILE_TYPE = (
('public', 'Public'),
('private', 'Private'),
)
 profile_type = forms.CharField(max_length=10, widget=RadioSelect
   (choices=PROFILE_TYPE),
   initial='Public',
   required=False
   )

I want that when i open this form the radio button with choice public
should be pre selected.
Can anybody explain what mistake you are doing ?

Thanks


-- 
Regards
Nikhil Verma
+91-958-273-3156

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




Re: PHP vs Django

2013-01-27 Thread Nikhil Verma
Google or any other company  looks for core python guys not web developer.
If you work on core python skills i think you will have a chance.

Always think work for yourself not for any company. You will learn a lot
and learn quickly.
Thats what people suggests me. Rest is what your stage of life is ?

Thanks


On Mon, Jan 28, 2013 at 9:24 AM, Vijaya Reddy P R wrote:

> Is it possible to get job in companies like Google,Amazon,Cisco,.
>
>
> On Sun, Jan 27, 2013 at 7:50 PM, Nikhil Verma wrote:
>
>> Well i would say  its all about money and passion for programming.In Web
>> development you are uncertain which you have to learn next.
>>
>> My personnel opinion:-
>>
>> php is a crap. Its a horrible language.
>>
>> Python well i would say the king of all and the framework Django is
>> amazing.
>>
>> Thanks
>>
>>
>>
>> On Mon, Jan 28, 2013 at 9:10 AM, Londerson Araújo wrote:
>>
>>> Man, i work with PHP for 5 years more or less, and Python is the
>>> the answer for my life.
>>>
>>> --
>>> 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?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>>
>> --
>> Regards
>> Nikhil Verma
>> +91-958-273-3156
>>
>>  --
>> 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?hl=en.
>> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Regards
Nikhil Verma
+91-958-273-3156

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-27 Thread Londerson Araújo
@Vijaya, if your preocuppation is a job, mas estudy php, there is a lot for
php guys! 70% more os less of the web is PHP!!

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




Re: PHP vs Django

2013-01-27 Thread Vijaya Reddy P R
Is it possible to get job in companies like Google,Amazon,Cisco,.


On Sun, Jan 27, 2013 at 7:50 PM, Nikhil Verma wrote:

> Well i would say  its all about money and passion for programming.In Web
> development you are uncertain which you have to learn next.
>
> My personnel opinion:-
>
> php is a crap. Its a horrible language.
>
> Python well i would say the king of all and the framework Django is
> amazing.
>
> Thanks
>
>
>
> On Mon, Jan 28, 2013 at 9:10 AM, Londerson Araújo wrote:
>
>> Man, i work with PHP for 5 years more or less, and Python is the
>> the answer for my life.
>>
>> --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Regards
> Nikhil Verma
> +91-958-273-3156
>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-27 Thread Nikhil Verma
Well i would say  its all about money and passion for programming.In Web
development you are uncertain which you have to learn next.

My personnel opinion:-

php is a crap. Its a horrible language.

Python well i would say the king of all and the framework Django is amazing.

Thanks


On Mon, Jan 28, 2013 at 9:10 AM, Londerson Araújo wrote:

> Man, i work with PHP for 5 years more or less, and Python is the
> the answer for my life.
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Regards
Nikhil Verma
+91-958-273-3156

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-27 Thread Edwin Lunando
Your question final answer is always go with your preference. PHP and 
Django is a whole different thing. PHP is a language and Django is a 
framework. If I tell you what to choose to build a web app, go for Django 
because it is a framework. Code a web app from scratch by PHP is 
just tormenting. PHP dose have a lot of framework that you can learn. will 
list some of both advantages.

PHP:

   1. Web standard
   2. Easy to deploy
   3. Lot's of framework choices
   4. Easier than Django to find host server that support PHP

Django:

   1. It's Python
   2. Django full-framework feature really lessen the code you need to write
   3. Django-admin give instant content management system that 
   production-ready
   4. Lot's of feature that can be found on Django documentation page.


On Monday, January 28, 2013 10:36:37 AM UTC+7, Vijaya Reddy wrote:
>
> Hello All,
>
> I want to build my career in web development. I have learned CSS,HTML,JS. 
> Now i am planning to learn either PHP or Dajngo. I have good knowledge in 
> python.
> Which one is good(Django or PHP)?
>
>
> Thanks and Regards
> Vijaya Reddy
>

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




Re: PHP vs Django

2013-01-27 Thread Vijaya Reddy
If i learn django, is it easy to get jobs?
Easy it possible to develop a site like www.99technuts.com and easy it easy 
to get job in google.?

Thanks
Vijay

On Sunday, January 27, 2013 7:40:45 PM UTC-8, Londerson Araújo wrote:
>
> Man, i work with PHP for 5 years more or less, and Python is the 
> the answer for my life. 

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




Model user with pk 1L does not exist at Admin

2013-01-27 Thread Edwin Lunando
Here is my model:

class UserSIMS(models.Model):
TATA_USAHA = 0
DOSEN = 1
MAHASISWA = 2
TYPE_CHOICES = ((TATA_USAHA, 'Tata Usaha'), (DOSEN, 'Dosen'), 
(MAHASISWA, 'Mahasiswa'))
user = models.OneToOneField(User)
type = models.IntegerField(choices=TYPE_CHOICES) # 0 = TU 1 = dosen 2 = 
mahasiswa

class Group(models.Model):
name = models.CharField(max_length=100)
lecturer = models.ForeignKey(User, null=True, blank=True, 
limit_choices_to={'usersims': UserSIMS.DOSEN})
company = models.ForeignKey(Company, null=True, blank=True)
tor = models.FileField(upload_to='tor', null=True, blank=True)
logact = models.FileField(upload_to='logact', null=True, blank=True)
document = models.FileField(upload_to='document', null=True, blank=True)
created_at = models.DateTimeField(null=True, blank=True)
updated_at = models.DateTimeField(null=True, blank=True)

def save(self, *args, **kwargs):
if not self.id:
self.created_at = datetime.datetime.today()
self.updated_at = datetime.datetime.today()
super(Group, self).save(*args, **kwargs)

And this is my group admin model

class GroupAdmin(admin.ModelAdmin):
list_display = ("name", "lecturer", "company")
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == "lecturer":
kwargs["queryset"] = 
User.objects.filter(usersims__type=UserSIMS.DOSEN)
return super(GroupAdmin, self).formfield_for_foreignkey(db_field, 
request, **kwargs)

admin.site.register(Group, GroupAdmin)

When i tried to update the group or add a new group, there are error like 
this "Model user with pk 1L does not exist". 




What should I do? Thanks in advance. :D

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-27 Thread Londerson Araújo
Man, i work with PHP for 5 years more or less, and Python is the the answer
for my life.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-27 Thread Sayth Renshaw
Why leave JS? Use node.js or meteor .
PHP has many frameworks any in particular you were referring to Cake,
symfony2, send?

Sayth

On Monday, January 28, 2013, Vijaya Reddy wrote:

> Hello All,
>
> I want to build my career in web development. I have learned CSS,HTML,JS.
> Now i am planning to learn either PHP or Dajngo. I have good knowledge in
> python.
> Which one is good(Django or PHP)?
>
>
> Thanks and Regards
> Vijaya Reddy
>
> --
> 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 'django-users@googlegroups.com');>
> .
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com  'django-users%2bunsubscr...@googlegroups.com');>.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




PHP vs Django

2013-01-27 Thread Vijaya Reddy
Hello All,

I want to build my career in web development. I have learned CSS,HTML,JS. 
Now i am planning to learn either PHP or Dajngo. I have good knowledge in 
python.
Which one is good(Django or PHP)?


Thanks and Regards
Vijaya Reddy

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




how can i prevent a user from viewin a page without using the django @login decorator

2013-01-27 Thread Okorie Emmanuel
i have a form that redirect a user to another page
when it validates 


but again i discover that a user can view the that page by typing it on his 
or her url
without following the normal process of validation

how can i stop this, how can i force a user to see that redirect page only 
when he/she  comes only from the main form page, what i mean a user 
can only be redirected to the accept page only when he has the valid 
credentials 
otherwise he/she cannot view the accept page even if he entered the correct 
url
on his browser.

 i intend doing  that without django @login decorator
 thanks 

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




Bookmarker Site

2013-01-27 Thread Ranjith Kumar
Hello All,
I wanted to build bookmarking web application using django, in this app
user can not only bookmark the site also they scrape few datas from the
bookmarked page.

Looking for good python/django tools which can help me achieve this aim

Thank you!

-- 
Cheers,
Ranjith Kumar K,
Chennai.

http://ranjithtenz.wordpress.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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How can i redirect a form to amother page when validation is correct

2013-01-27 Thread Okorie Emmanuel
thanks for your help

 the from redirected when i used 
accept = Pin.objects.get(pin=pin1, serial_no=serial_no1)

but again i discover that a user can view the accept page by typing it on 
his or her url
without following the normal process of entering pin and serial no first 

how can i stop this, how can i force a user to see that accept page only 
when he/she is comes only from the main form page, what i mean a user 
can only be redirected to the accept page only when he has the valid 
credentials 
otherwise he/she cannot view the accept page even if he entered the correct 
url
on his browser. thanks 


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




Polls tutorial receive object not object representation

2013-01-27 Thread Sayth Renshaw
Hi

Just seeking a little clarification.

In the Polls tutorial we get this section.

>>> p = Poll.objects.get(pk=1)
# Display any choices from the related object set -- none so far.>>> 
p.choice_set.all()[]
# Create three choices.>>> p.choice_set.create(choice_text='Not much', 
votes=0)>>> p.choice_set.create(choice_text='The sky', 
votes=0)>>> c = p.choice_set.create(choice_text='Just hacking 
again', votes=0)
# Choice objects have API access to their related Poll objects.>>> c.poll
# And vice versa: Poll objects get access to Choice objects.>>> 
p.choice_set.all()[, , ]

Now the only thing is that when I call p.choice_set.all() I don't get the 
representation 'The sky' or 'Just Hacking again' . I receive choice object 
itself. Is this normal?

In [14]: c = p.choice_set.create(choice_text='Just Hacking again', votes=0)

In [15]: c.poll
Out[15]: 

In [16]: p.choice_set.all()
Out[16]: [, , , ]

Thanks 

Sayth

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




modular CBVs

2013-01-27 Thread Rainy
Hi, I've written modular class-based views, based on generic views 
distributed
 with Django, and uploaded the initial version today:

http://lightbird.net/mcbv/

The main difference vs. generic CBVs is that you can easily combine 
different
 views together, e.g. detail, create, list - in a single view without any 
extra work.

I've also added FormSetView which works similarly to UpdateView and 
FormView.

I'd be glad to hear some feedback on my implementation.. thanks!




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




Re: Form with variable fields

2013-01-27 Thread Arnold Krille
On Sat, 26 Jan 2013 17:38:03 -0800 (PST) sephii
 wrote:
> Thanks for your answer. I wanted to avoid using a ManyToMany field in
> my case for two reasons:
> 1. The artist table has about 700'000 entries, which is really too
> big to fit in a  element
> 2. I could create an autocomplete text widget to overcome point 1),
> but the user should also be able to set a new artist that doesn't
> exist yet in the database using these fields
> 
> Feel free to let me know if you think of a solution that would
> overcome these 2 issues.

1) Tell django to use a text-input or your own widget to display the
artist-field.
2) Write your own widget to enter text, search via ajax and then set
the artist.

At least thats what we do with m2m-fields with ~20.000 entries.

Have fun,

Arnold


signature.asc
Description: PGP signature


Re: Using the Django development server for local subdomain development

2013-01-27 Thread Fabian Büchler
It's actually quite easy to test a subdomain setup with the run server and any 
web server like Apache or nginx.

I'm commonly using nginx to do this, plus a few entries in my /etc/hosts file:

127.0.0.1   some.domain.localhost
127.0.0.1   other.domain.localhost

And the nginx configuration works like this:

upstream runserver {
server 127.0.0.1:8000;
}

server {
listen  80;
server_name some.domain.localhost
other.domain.localhost;

access_log  /usr/local/var/log/nginx/domain.access.log main;
error_log   /usr/local/var/log/nginx/domain.error.log;
root/Users/you/Site/domain;

proxy_set_header Host$host;
proxy_set_header X-Real-IP   $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

location / {
try_files $uri @django;
}

location @django {
proxy_pass   $scheme://runserver;
}
}

That's it.

Cheers, Fabian

On 27.01.2013, at 02:27, Russell Keith-Magee  wrote:

> 
> The best approach I've found is to use xip.io. xip.io is a service that is 
> actually provided by the 37 Signals guys, but it works for any web project 
> (not just Rails). I'll honour a good idea wherever it comes from.
> 
> It's a DNS server with unusual behaviour: If you prepend an IP address to the 
> start of .xip.io, it will return that IP address as the resolved IP for the 
> domain.
> 
> So - if you set your server running on 127.0.0.1:8000, but point your browser 
> at http://127.0.0.1.xip.io:8000, it will resolve to 127.0.0.1. 
> 
> Then, you can use your subdomain; bob.127.0.0.1.xip.io:8000 will resolve to 
> your development server, but with a request header that tells you the 
> subdomain.
> 
> I've found it very useful for testing subdomains.
> 
> Yours,
> Russ Magee %-)
> 
> On Sun, Jan 27, 2013 at 7:47 AM, Brian Dant  wrote:
> I'm trying to create a development environment that supports testing my 
> subdomain configuration.  I'll be using the django-subdomains package, which 
> relies on the sites framework.  To make a local environment that supports 
> this while using the Django built-in webserver, do I need to set up local 
> DNS?  Most of the solutions I see rely on Apache, and refer to the /etc/hosts 
> file.  I've tried to use that, but nothing happens when I hit the name I 
> think should map to 127.0.0.1:8000.
> 
> -- 
> 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.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> 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 post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> 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 post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.