Re: How can I send a password recovery e-mail to a Customer/User in Django?

2016-09-27 Thread João Rodrigues
Thanks a lot. I solved it. :)

I got some more information in this page:

http://www.programcreek.com/python/example/61528/django.contrib.auth.forms.PasswordResetForm

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f7ae3f1d-bef7-4d49-bcf6-9424f09b51f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to populate a JqGrid in Django with data obtained from a query (queryset)

2016-09-27 Thread João Rodrigues
Thanks for your answer. The project is rather big and I am still not used 
to Django. I got some help and it has been solved.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dcda40e4-9587-4caf-90b9-963dfc83c0a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to populate a JqGrid in Django with data obtained from a query (queryset)

2016-09-25 Thread João Rodrigues
I am working on a small online shop with Django 1.9 and JqGrid

Here is a simplification of my models:

class Addresses(models.Model):
address = models.TextField(db_column='ADDRESS', max_length=2000)
city = models.CharField(db_column='CITY', max_length=400, 
blank=True, null=True)
postal_code = models.CharField(db_column='POSTAL_CODE', 
max_length=200, blank=True, null=True)
state = models.CharField(Country, db_column='STATE', 
max_length=400, blank=True, null=True)
country = models.ForeignKey(Country, db_column='COUNTRY_ID', 
null=True)

class Customers(models.Model):
name = models.CharField(db_column='NAME', max_length=400)
nif = models.CharField(db_column='NIF', max_length=200, null=True, 
blank=True)
email = models.CharField(db_column='EMAIL', max_length=255, 
unique=True)
mobile_number = models.CharField(db_column='MOBILE_NUMBER', 
max_length=200, blank=True, null=True)
phone_number = models.CharField(db_column='PHONE_NUMBER', 
max_length=200, blank=True, null=True)
addresses = models.ManyToManyField(Addresses, 
through='CustomerAddresses')


class CustomerAddresses(models.Model):
id = models.AutoField(db_column='ID', primary_key=True)
address_name = models.CharField(db_column='ADDRESS_NAME', 
max_length=100)
customer = models.ForeignKey(Customers)
address = models.ForeignKey(Addresses)


class Orders(models.Model):
order_number = models.IntegerField(db_column='ORDER_NUMBER', 
unique=True)
customer = models.ForeignKey('Customers', db_column='CUSTOMER_ID')
payment_date = models.DateTimeField(db_column='PAYMENT_DATE', 
blank=True, null=True)
payment_method = models.CharField(db_column='PAYMENT_METHOD', 
max_length=400, blank=True, null=True)
delivery_address = models.ForeignKey('Addresses', 
db_column='ORDER_DELIVERY_ADDRESS_ID', related_name='delivery_address', 
blank=True, null=True)


I want an edit page for a given Customer to look like this:




At the bottom, I want to display grids (JqGrid) inside jQuery tabs.

The Orders grid, should contain all the orders that are associated with the 
current Customer

queryset = Orders.objects.filter(customer=customer_pk)

Idem, for the Addresses.

As you can see, I successfully created the tabs and grid, BUT the grids are 
not filled with the required data (queryset).

Could you help me understand how I should populate the grids with the data 
I want?

I am sorry if this question is not well explained. I am new in Django. If 
there is something you don't understand, please tell me.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7e9b341-f5e3-4010-bb63-78d4bec635ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I send a password recovery e-mail to a Customer/User in Django?

2016-09-25 Thread João Rodrigues
I am working on a small online shop with Django 1.9 and I have a Customers 
page.

Note: This is the back-end site. Only for me...




Clicking on the green lock icon should send a password recovery e-mail to 
the e-mail address of the Customer of that row.

We assume that I can easily fetch the e-mail address of the targeted 
Customer, and that there is no need to check if the e-mail address is 
valid, because it is already in the system.

How could I achieve the action of sending a password recovery e-mail to 
that user?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/688c1a12-a7c2-4817-8c26-34ce59ab5c35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IDE for Python/django

2010-09-27 Thread João Rodrigues
http://code.google.com/p/trespams-vim/

On 27 September 2010 14:00, girish shabadimath  wrote:
> actually i use vim for writing python scripts , i wanted IDE to easy my
> tasks of writing script (like auto-completion) ,,,i dont want GUI based,,i
> prefer  editor like vim which supports python scripts
>
> On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube 
> wrote:
>>
>> Hi Girish,
>>
>> I do not know what platform you work on, but on Windows try Jetbrains
>> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter is
>> also available on Windows).
>>
>> What are you looking for in an IDE? Give more info to get a better answer.
>>
>> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn  wrote:
>>>
>>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>>> > hi all,
>>> >
>>> > is there any IDE for Python/Django ?
>>> Yes.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@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.
>>>
>>
>>
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.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-us...@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.
>
>
>
> --
> Girish M S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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-treebeard: one tree per user?

2010-09-27 Thread João Rodrigues
Is it possible to have a tree for each user? I was trying something like this

# - models.py -- #
from django.db import Models
from django.contrib.auth.models import User
from treebeard.mp_tree import MP_Node

class MyTree(MP_Node):
user = models.ForeignKey(User)
desc = models.CharField(max_length=255)

def __unicode__(self):
return self.desc

class Meta:
unique_together = [('path', 'user')]

# - admin.py - #
from django.contrib import admin
from myProject.myApp.models import MyTree
from treebeard.admin import TreeAdmin

class MyTreeAdmin(TreeAdmin):
list_filter = (
'user',
)

admin,site.register(MyTree, MyTreeAdmin)

# - end of admin.py -- #

But the path gets kind of messed up and I get IntegrityErrors.
Also in the admin interface filtering by user is ignored by the tree interface.

What am I doing wrong here?

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



Re: How to display the user profile in the admin interface?

2010-09-03 Thread João Rodrigues
I fixed this in admin.py:

from django.contrib.auth.admin import UserAdmin
class UserProfileInline(admin.StackedInline):
model = UserProfile

class UserWithProfileAdmin(UserAdmin):
inlines = [UserProfileInline]

admin.site.unregister(User)
admin.site.register(User, UserWithProfileAdmin)


On 30 August 2010 17:14, João Rodrigues  wrote:
> Thanks, I did run syncdb and added myapp to the INSTALLED_APPS.
> "Company" appears in the admin interface under myapp.
>
> But what I wanted to do is to show the UserProfile fields in the
> Add/Change user page.
>
> I was thinking in subclassing django.contrib.auth.admin.UserAdmin and
> adding the UserProfile fields to the fieldsets, unregister(User) and
> register(User, UserWithProfileFields)
>
> is there another way?
>
> On 30 August 2010 16:30, Sithembewena Lloyd Dube  wrote:
>> Don't forget to run manage.py syncdb to create table/s for your model/s.
>>
>> On Mon, Aug 30, 2010 at 5:28 PM, Sithembewena Lloyd Dube 
>> wrote:
>>>
>>> Hi João,
>>>
>>> Add myapp.UserProfile to the INSTALLED_APPS global variable of your
>>> settings.py file, and in your admin.py file, import the model/s.
>>>
>>> On Mon, Aug 30, 2010 at 5:04 PM, João Rodrigues 
>>> wrote:
>>>>
>>>> I have a company model
>>>>
>>>> class Company(models.Model):
>>>>    name = models.CharField(max_length=50)
>>>>    address = models.TextField()
>>>>    phone = models.CharField(max_length=15)
>>>>    fax = models.CharField(max_length=15)
>>>>
>>>> and I wanted to associate each user to a company, so I read
>>>>
>>>> http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
>>>> added AUTH_PROFILE_MODULE = "myapp.UserProfile" to settings.py and
>>>> created a UserProfile model
>>>>
>>>> class UserProfile(models.Model):
>>>>    user = models.OneToOneField(User)
>>>>    company = models.OneToOneField(Company)
>>>>
>>>>
>>>> How do I make it appear in the admin interface?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "Django users" group.
>>>> To post to this group, send email to django-us...@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.
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Sithembewena Lloyd Dube
>>> http://www.lloyddube.com
>>
>>
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.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-us...@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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to display the user profile in the admin interface?

2010-08-30 Thread João Rodrigues
Thanks, I did run syncdb and added myapp to the INSTALLED_APPS.
"Company" appears in the admin interface under myapp.

But what I wanted to do is to show the UserProfile fields in the
Add/Change user page.

I was thinking in subclassing django.contrib.auth.admin.UserAdmin and
adding the UserProfile fields to the fieldsets, unregister(User) and
register(User, UserWithProfileFields)

is there another way?

On 30 August 2010 16:30, Sithembewena Lloyd Dube  wrote:
> Don't forget to run manage.py syncdb to create table/s for your model/s.
>
> On Mon, Aug 30, 2010 at 5:28 PM, Sithembewena Lloyd Dube 
> wrote:
>>
>> Hi João,
>>
>> Add myapp.UserProfile to the INSTALLED_APPS global variable of your
>> settings.py file, and in your admin.py file, import the model/s.
>>
>> On Mon, Aug 30, 2010 at 5:04 PM, João Rodrigues 
>> wrote:
>>>
>>> I have a company model
>>>
>>> class Company(models.Model):
>>>    name = models.CharField(max_length=50)
>>>    address = models.TextField()
>>>    phone = models.CharField(max_length=15)
>>>    fax = models.CharField(max_length=15)
>>>
>>> and I wanted to associate each user to a company, so I read
>>>
>>> http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
>>> added AUTH_PROFILE_MODULE = "myapp.UserProfile" to settings.py and
>>> created a UserProfile model
>>>
>>> class UserProfile(models.Model):
>>>    user = models.OneToOneField(User)
>>>    company = models.OneToOneField(Company)
>>>
>>>
>>> How do I make it appear in the admin interface?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@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.
>>>
>>
>>
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.com
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
> http://www.lloyddube.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-us...@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-us...@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.



How to display the user profile in the admin interface?

2010-08-30 Thread João Rodrigues
I have a company model

class Company(models.Model):
name = models.CharField(max_length=50)
address = models.TextField()
phone = models.CharField(max_length=15)
fax = models.CharField(max_length=15)

and I wanted to associate each user to a company, so I read
http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users
added AUTH_PROFILE_MODULE = "myapp.UserProfile" to settings.py and
created a UserProfile model

class UserProfile(models.Model):
user = models.OneToOneField(User)
company = models.OneToOneField(Company)


How do I make it appear in the admin interface?

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



Re: how to turn off CSRF in django 1.2?

2010-08-26 Thread João Rodrigues
what about 'django.contrib.csrf.middleware.CsrfMiddleware' ?
http://docs.djangoproject.com/en/1.0/ref/contrib/csrf/#how-to-use-it

On 26 August 2010 16:33, Alan  wrote:
>
> Ops, sorry, but I don't have this line
> django.middleware.csrf.CsrfViewMiddleware, as I said, it's a project
> done in 1.0.2. and I want it to run on my django 1.2 but without any
> reference to Csrf, since the server where the portal is runs 1.0.2
> yet.
>
> On 26 Aug, 15:54, João Rodrigues  wrote:
> > go to your settings.py and comment out
> > django.middleware.csrf.CsrfViewMiddleware in your MIDDLEWARE_CLASSES
> >
> > On 26 August 2010 10:33, Alan  wrote:
> >
> >
> >
> > > Hi there,
> >
> > > I developed in a system that uses django 1.2, but the server is still
> > > django 1.0.2.
> >
> > > Upgrading for a moment is not possible. Unless someone knows a nice
> > > simple alternative, in order to keep my web portal compatible between
> > > 1.0.2 and 1.2, I would like to switch off CSRF on my developing
> > > computer.
> >
> > > How can I do this simply and easily?
> >
> > > Many thanks,
> >
> > > Alan
> >
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com > >  groups.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-us...@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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to turn off CSRF in django 1.2?

2010-08-26 Thread João Rodrigues
go to your settings.py and comment out
django.middleware.csrf.CsrfViewMiddleware in your MIDDLEWARE_CLASSES

On 26 August 2010 10:33, Alan  wrote:

> Hi there,
>
> I developed in a system that uses django 1.2, but the server is still
> django 1.0.2.
>
> Upgrading for a moment is not possible. Unless someone knows a nice
> simple alternative, in order to keep my web portal compatible between
> 1.0.2 and 1.2, I would like to switch off CSRF on my developing
> computer.
>
> How can I do this simply and easily?
>
> Many thanks,
>
> Alan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.



How to Create a TextField and read data from it

2008-05-09 Thread João Rodrigues
Hello all. I'm new to Django, and to web development, so feel free to point
me to the manual if you need to :)

I am having a small problem developing a web interface for an application
(100% written in Python) I built. At first, I tried to use Ruby on Rails, as
advised by a friend, but since I was using Python, it felt weird (much like
treason actually:) to use a non-pythonic framework when there were some
available. However, I gave it a (tiny) try and got to a draft webpage of
what I wanted. In Django, I haven't been able to reproduce that webpage.

What I'm trying to do, is a simple text form where the user can type a few
lines of text, numbers, whatever. Then, I want to capture what he/she wrote,
parse it and pass it on to my python application. I am having trouble in the
very first part of the process: building the text form.

So, all in all, I'm asking, if that's not too much, for you to point me to a
readable solution (I read the new forms tutorial and to be honest, I got
confused :\ ) or examples.

Thanks in advance

-- 
João Rodrigues

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---