Re: How to use django Cooment framework

2013-01-28 Thread Sarfraz ahmad
can someoe give me some hints to attach multiple answers with a question
field

On Tue, Jan 29, 2013 at 10:17 AM, Sarfraz ahmad wrote:

> yes, i read the docs bt looking for an example which shows how can
> comments to be assigned to an object
>
>
> On Mon, Jan 28, 2013 at 10:49 PM, carlos  wrote:
>
>> Hi you read the doc.
>>
>> https://docs.djangoproject.com/en/dev/ref/contrib/comments/
>>
>> https://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/
>>
>> :)
>>
>>
>> On Mon, Jan 28, 2013 at 11:13 AM, Sarfraz ahmad 
>> wrote:
>>
>>> good evening friends
>>>
>>> i m a new django user, i want to implement comment framework in my
>>> app.. please help me and tell me that how can i use django comment
>>> framework to assign comments with an object..
>>>
>>> in my view i want to ask questions from users which can have multiple
>>> answers i want to achieve this using django comment framework
>>>
>>> please help me.. thanx alll
>>>
>>> --
>>> 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 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: how to use django password reset

2013-01-28 Thread Sarfraz ahmad
thanx Bill, it gives me idea how password reset works in django

On Tue, Jan 29, 2013 at 12:13 AM, Bill Freeman  wrote:

> Assuming that you are talking about the registered user's ability to set a
> new password after forgetting the old password:
>
>   The Django installation must be configured to be able to send E-mail
>   The user must have a valid E-mail address stored in his User object
>   The forgotten password page allows the user to be specified (username or
> you can fancy it up)
>   The Django installation records a special token in association with the
> user (also an expiration time), and sends a link that includes that token
> to the user's E-mail address.
>   The user sees the E-mail, and assuming that is was him, rather than
> someone else trying to steal his account, he clicks on the link.
>   The view there gets the token as an argument, uses it to look up the
> reset object, and if it isn't expired by this time, offers password and
> confirmation fields that it will use to reset the user's password.
>
> It's a complex process for security's sake.  Hopefully the overview above
> will help you to understand the documentation.
>
> Bill
>
> On Mon, Jan 28, 2013 at 11:55 AM, Sarfraz ahmad 
> wrote:
>
>> How can i use django password reset method
>>  unable to understand the django documentation about password reset.
>>
>>  --
>> 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 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: How to use django Cooment framework

2013-01-28 Thread Sarfraz ahmad
yes, i read the docs bt looking for an example which shows how can comments
to be assigned to an object

On Mon, Jan 28, 2013 at 10:49 PM, carlos  wrote:

> Hi you read the doc.
>
> https://docs.djangoproject.com/en/dev/ref/contrib/comments/
>
> https://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/
>
> :)
>
>
> On Mon, Jan 28, 2013 at 11:13 AM, Sarfraz ahmad 
> wrote:
>
>> good evening friends
>>
>> i m a new django user, i want to implement comment framework in my
>> app.. please help me and tell me that how can i use django comment
>> framework to assign comments with an object..
>>
>> in my view i want to ask questions from users which can have multiple
>> answers i want to achieve this using django comment framework
>>
>> please help me.. thanx alll
>>
>> --
>> 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 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: Missing files on a new project

2013-01-28 Thread Ricardo Diaz
Well, i'm following a video tutorial -> this guy is using Django 1.4 and 
when he uses startmanager on shell Django creates all of those files on the 
main folder.

Check it about 3:11 https://www.youtube.com/watch?v=fVNL5MwskiQ

That is the reason why I'm asking for help.

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




Unicode/Non-ASCII characters in the admin throws exception

2013-01-28 Thread Thomas Weholt
This is a recurring problem for django users obviously by the amount of 
posts returned by google and I've had this problem in the past as well, but 
cannot remember how I got around it. Googling did'nt help either.

When I use Norweian characters like ØÆÅ in CharField-field in the django 
admin I get an exception when I click the add-button to register the new 
entry.

Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in 
get_response  136. response = response.render()File 
"C:\Python27\lib\site-packages\django\template\response.py" in render  104. 
self._set_content(self.rendered_content)File 
"C:\Python27\lib\site-packages\django\template\response.py" in 
rendered_content  81. content = template.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  140. 
return self._render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in _render  134.   
  return self.nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\loader_tags.py" in render  
123. return compiled_parent._render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in _render  134.   
  return self.nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\loader_tags.py" in render  
123. return compiled_parent._render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in _render  134.   
  return self.nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\loader_tags.py" in render  
123. return compiled_parent._render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in _render  134.   
  return self.nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\defaulttags.py" in render  
281. return nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\loader_tags.py" in render  
62. result = block.nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\defaulttags.py" in render  
281. return nodelist.render(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in render  823. 
bit = self.render_node(node, context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render_node  
74. return node.render(context)File 
"C:\Python27\lib\site-packages\django\template\debug.py" in render  84. 
output = self.filter_expression.resolve(context)File 
"C:\Python27\lib\site-packages\django\template\base.py" in resolve  599.   
  new_obj = func(obj, *arg_vals)File 
"C:\Python27\lib\site-packages\django\template\defaultfilters.py" in _dec  
39. args[0] = force_unicode(args[0])File 
"C:\Python27\lib\site-packages\django\utils\encoding.py" in force_unicode  
74. s = unicode(str(s), encoding, errors)
Exception Type: UnicodeEncodeError at /admin/storyquest/story/11/Exception 
Value: 'ascii' codec can't encode character u'\xd8' in position 0: ordinal 
not in range(128)

I'm running Python 2.7.3, django 1.4.3 on Windows 8 64bit. The model in 
question:

class Story(models.Model):
title = models.CharField(max_length=200)


Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this 

Jython + Django on JBoss

2013-01-28 Thread Milind
Has anyone used Jython and Django and used it in full JavaEE applications like 
JBoss? If so I would like to know how painfull/easy is it to set it up. Also 
some info about its performance in production would be great.

Thanks,

Sent from my IPhone 

-- 
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: how to use django password reset

2013-01-28 Thread Bill Freeman
Assuming that you are talking about the registered user's ability to set a
new password after forgetting the old password:

  The Django installation must be configured to be able to send E-mail
  The user must have a valid E-mail address stored in his User object
  The forgotten password page allows the user to be specified (username or
you can fancy it up)
  The Django installation records a special token in association with the
user (also an expiration time), and sends a link that includes that token
to the user's E-mail address.
  The user sees the E-mail, and assuming that is was him, rather than
someone else trying to steal his account, he clicks on the link.
  The view there gets the token as an argument, uses it to look up the
reset object, and if it isn't expired by this time, offers password and
confirmation fields that it will use to reset the user's password.

It's a complex process for security's sake.  Hopefully the overview above
will help you to understand the documentation.

Bill

On Mon, Jan 28, 2013 at 11:55 AM, Sarfraz ahmad wrote:

> How can i use django password reset method
>  unable to understand the django documentation about password reset.
>
> --
> 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.




Re: How to use django Cooment framework

2013-01-28 Thread carlos
Hi you read the doc.

https://docs.djangoproject.com/en/dev/ref/contrib/comments/

https://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/

:)


On Mon, Jan 28, 2013 at 11:13 AM, Sarfraz ahmad wrote:

> good evening friends
>
> i m a new django user, i want to implement comment framework in my
> app.. please help me and tell me that how can i use django comment
> framework to assign comments with an object..
>
> in my view i want to ask questions from users which can have multiple
> answers i want to achieve this using django comment framework
>
> please help me.. thanx alll
>
> --
> 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 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.




How to use django Cooment framework

2013-01-28 Thread Sarfraz ahmad
good evening friends

i m a new django user, i want to implement comment framework in my 
app.. please help me and tell me that how can i use django comment 
framework to assign comments with an object..

in my view i want to ask questions from users which can have multiple 
answers i want to achieve this using django comment framework

please help me.. thanx alll

-- 
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-28 Thread carlos
Hi man learn both or not more lenguages: python,ruby,php,javascript and
them framework Django, ruby on rails, symfony2,nodejs, etc etc. Not only
one XD

Cheers :)


On Sun, Jan 27, 2013 at 9:58 PM, Edwin Lunando wrote:

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

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




how to use django password reset

2013-01-28 Thread Sarfraz ahmad
How can i use django password reset method
 unable to understand the django documentation about password reset.

-- 
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-28 Thread Chen Xu
Thanks for the info, pyapns looks pretty nice, I am wondering what are the
top python notification third party libraries in market, I mean the most
used.


Thanks


On Mon, Jan 28, 2013 at 1:32 AM, Pankaj Singh  wrote:

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


-- 
⚡ Chen Xu ⚡

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




Identify what management command is being executed

2013-01-28 Thread Ali
In my django project I have written some custom management commands which 
run on the server. These custom commands in turn call different functions 
during execution. I want a way to set a global variable/field or a way to 
find out what command is being executed. One obvious usage is write log 
messages, so that it can identified what command they are coming from.

A simplified version is:

In one module I have:

class Command(BaseCommand):
args = ''
help = 'Identifies inconsistent data between activity_log and User 
points collcetion. This will overwrite the previous inconsistencies 
identified'

def handle(self, *args, **options):
   functionA()

In another module I have:

class Command(BaseCommand):
args = ''
help = 'Identifies inconsistent data between activity_log and User 
points collcetion. This will overwrite the previous inconsistencies 
identified'

def handle(self, *args, **options):
   functionA()
   
  
def FuncA()
# I want a way to findout where it was called from / What command is being 
executed.
# I can do parameters but there is complex chain of functions being called 
and passing parameter in each would be too tedious.

-- 
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: Model user with pk 1L does not exist at Admin

2013-01-28 Thread Bill Freeman
What python version are you using, and with what django version.  Also,
please show an example of what code you are using/typing to update/add a
group.

On Sun, Jan 27, 2013 at 10:40 PM, Edwin Lunando wrote:

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

-- 
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: Problem configuring Django 1.5b2 with PostGIS 2.0

2013-01-28 Thread victoria
On Fri, Jan 25, 2013 at 5:38 AM, Joe Jasinski wrote:

> I've been experiencing the same issue on OSX 10.8.2.
>
> $ ./manage.py shell
>
> ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND
> "geos".
>
> I've installed Postgresapp (http://postgresapp.com/documentation), which
> includes Postgres 9.2.2, PostGIS 2.0.2, GEOS 3.3.5, and Proj (not sure of
> the version, but likely recent).  Note: I also got the same error when
> installing postgres from homebrew.  Various tutorials indicate that I
> should set the following in settings.py.  (
> http://wiki.bitnami.org/Components/Django/GoeDjango_with_PostGIS_Quick_Start_Guide
> )
>
>
> GDAL_LIBRARY_PATH="/Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib"
>
> GEOS_LIBRARY_PATH="/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib"
> GDAL_DATA="/Applications/Postgres.app/Contents/MacOS/share/gdal"
>
> Upon doing so, I get a different error.
>
> OSError:
> dlopen(/Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib, 6):
> Library not loaded: @executable_path/../lib/libgeos-3.3.5.dylib
>   Referenced from:
> /Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib
>   Reason: image not found
>
> Below is evidence that the files from PATH statements above do exist.
>
> $ ls -la /Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib
> lrwxr-xr-x@ 1 jjasinski  staff  15 Jan 24 20:56
> /Applications/Postgres.app/Contents/MacOS/lib/libgdal.dylib ->
> libgdal.1.dylib
>
> $ ls -la /Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib
> lrwxr-xr-x@ 1 jjasinski  staff  17 Jan 24 20:56
> /Applications/Postgres.app/Contents/MacOS/lib/libgeos_c.dylib ->
> libgeos_c.1.dylib
>
> $ ls -ald /Applications/Postgres.app/Contents/MacOS/share/gdal
> drwxr-xr-x@ 47 jjasinski  staff  1598 Jan 24 20:56
> /Applications/Postgres.app/Contents/MacOS/share/gdal
>
> My next step is to try to get this running in an Ubuntu virtual machine,
> but I'd really like to get it work natively in OSX.
>


I see that you include a reference to the BitNami documentation, however
just to confirm, none of you is working with the BitNami Django Stack,
right? In any case the documentation although tested with BitNami should be
quite general. Maybe it is a compatibility issue with the different
components. Also you mentioned that you'd like to get it working on OS X,
have you tried BitNami? It should work, or at least we may be able to
provide support if you find any issue.

Best regards,

Victoria.



>
>
> On Friday, December 28, 2012 11:05:57 AM UTC-6, Odagi wrote:
>>
>> Hi, I have been struggling for two days to get a GeoDjango/PostGIS
>> project started and I'll appreciate any help. Thanks
>>
>> == My project ==
>>
>> Two virtual machines:
>>Machine 1: Running Django 1.5b2
>>Machine 2: Running a geospatial DB server (postgresql-server-dev-9.1,
>> **geos-3.3.5, proj-4.8.0, **postgis-2.0.2)
>>
>> == My (wrong??) assumption ==
>>
>> I don't need to install any geos/postgis library on Machine 1. Please
>> let me know if this is incorrect.
>>
>> == My Problem ==
>>
>> When I run:
>> $  manage.py validate
>>
>> The result is:
>> ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND
>> "geos".
>>
>> == Tring to fix this ==
>>
>> In Machine 1 (where I have my Django application), I include this line in
>> settings.py
>>
>> GEOS_LIBRARY_PATH = '/opt/geos/lib/libgeos_c.so'
>>
>> But this path is the location of Geos library in Machine 2 (my DB server).
>> When I run $ manage.py validate, I get this error:
>>
>> OSError: /opt/geos/lib/libgeos_c.so: cannot open shared object file: No
>> such file or directory
>>
>> So, may be I need some Geos libraries in Machine 1 in order to Django
>> communicate with PostGIS, but I'm not sure.
>> Any ideas?
>>
>>
>>
>>
>>
>>
>>
>>
>>  --
> 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.




Make the prepopulated slug field as readonly in Django Admin

2013-01-28 Thread Meenakshi
I want to make the slug field as read_only depending on the other field 
value like "lock_slug". 

Means There will be Two conditions.

1) When value of "lock_slug" is false then the slug field directly 
prepopulated from the field "title".

prepopulated_fields = {"slug": ("title",),}

2) When value of "lock_slug" is true then the slug field make as readonly.

def get_readonly_fields(self, request, obj = None):
if obj and obj.lock_slug == True:
return ('slug',) + self.readonly_fields
return self.readonly_fields

These two works fine independently, but problematic when used both.

Means when I try to add get_readonly_fields() on edit then it gives error 
because of prepopulated_fields.These two crashes with each other.

There will be any solution for working both on admin side?

I also refer below links

http://stackoverflow.com/questions/11601148/making-a-field-readonly-in-django-admin

http://stackoverflow.com/questions/4343535/django-admin-make-a-field-read-only-when-modifying-obj-but-required-when-adding

But not working these both at the same time.

Thanks,

Meenakshi

-- 
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-28 Thread Tim Akinbo
The initial parameter should be in the CharField method and not RadioSelect
like you've specified it.

Cheers.
On Jan 28, 2013 6:35 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
>
> --
> 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 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: how can i prevent a user from viewin a page without using the django @login decorator

2013-01-28 Thread Tim Akinbo
Hi Emmanuel,

Also in a similar thought like Siddharth mentioned, what is your definition
of valid credentials? If valid credentials means a username and password,
then you will need to use sessions to check if the user is authenticated.
Basically you store a value in the session when authentication is
successful and you check for that value in your target view.

If by valid credentials, you mean ensuring that the user is navigating from
the source view, you could look into checking the value of the Referer
header just before granting access. It should match with the source view
url.

HTH
On Jan 28, 2013 10:45 AM, "Siddharth Ghumre" 
wrote:

> Hi
>
> Are you storing the user data in some database table?
> If yes, then you can search for the logged in user with the user data
> present in database table.
> If you dont find a match then you can send to some error page or re-login
> page.
>
> -Siddharth
> On Mon, Jan 28, 2013 at 8:32 AM, Okorie Emmanuel 
> wrote:
> > 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.
> >
> >
>
> --
> 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.




image browsing from a textfield

2013-01-28 Thread Wim Feijen
Hello, 

For an e-learning app in development, we want editors to be able to edit 
html (TextField) within our app (not the admin), and insert formatted text, 
images and (Vimeo) video in there.

At the moment, I am looking into using TinyMCE (django-tinymce) combined 
with django-filebrowser. During my research, I came across many other 
solutions (Mezzanine, markup, django-adminfiles, oembed).

I am curious at what solutions you chose in order to edit html with images 
and why?

Best regards, Wim

-- 
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: Polls tutorial receive object not object representation

2013-01-28 Thread James Schneider
On Jan 27, 2013 5:58 PM, "Sayth Renshaw"  wrote:
>
> 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]: [, , ,  ject>]

You probably need a p.save() after creating the choices to actually place
them in the database...otherwise I can see why the ORM is confused since
choices_set causes a database hit and you are expecting objects that don't
technically exist yet...

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

-- 
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 prevent a user from viewin a page without using the django @login decorator

2013-01-28 Thread Siddharth Ghumre
Hi

Are you storing the user data in some database table?
If yes, then you can search for the logged in user with the user data
present in database table.
If you dont find a match then you can send to some error page or re-login page.

-Siddharth
On Mon, Jan 28, 2013 at 8:32 AM, Okorie Emmanuel  wrote:
> 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.
>
>

-- 
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: initial argument in forms not working for me

2013-01-28 Thread Sergiy Khohlov
 I'm using dynamic initialization for this case . I've written a post
in my blog about this long time ago :
http://skhohlov.blogspot.com/2012/04/passing-values-from-view-to-form.html

Many thanks,

Serge


+380 636150445
skype: skhohlov


2013/1/28 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.
>
>

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