Re: Django admin application for Android

2019-07-21 Thread Jens-Joris Decorte
Hi Alexandre, the app is written in Kotlin. Looked for using flutter but 
the webview support is not quite there yet..

Op woensdag 17 juli 2019 17:26:04 UTC+2 schreef Alexandre Guignard:
>
> That's cool, thanks 😉 
> Which langage do You use for the app ?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e27ac91-ffd4-4bfa-9c8c-5d4c27ba87a2%40googlegroups.com.


Re: Django admin application for Android

2019-07-21 Thread Jens-Joris Decorte
Hi Derek,

The GOLD plan is for users who want to manage multiple projects.
On top of that they get some other benefits like using shortcuts and 
rearranging the order of the models.

This is $0.99 per month as a way to support my development :-)

Kind regards

Op woensdag 17 juli 2019 08:11:56 UTC+2 schreef Derek:
>
> Can you explain more about the GOLD plan - what is it and how much does it 
> cost?
>
> On Monday, 15 July 2019 12:51:58 UTC+2, Jens-Joris Decorte wrote:
>>
>> Hello Django developers!
>>
>> Being both a Django developer and a heavy user of Django applications, I 
>> found myself accessing the admin interface of my Django sites quite often 
>> via my smartphone when I am on the road.
>> I was stoked to see the new responsive admin since Django 2.0, which made 
>> this process much smoother.
>>
>> Lately I've been developing an *Android app* to access your site's 
>> admin. It ports the *responsive design to ALL Django versions* and 
>> includes even more features to make the experience very mobile friendly.
>> I have just released this app on the Google Play Store 
>>  so 
>> feel free to check it out or to share it with other Django developer / 
>> users. Any feedback will also be appreciated!
>>
>> The app can be found here: 
>> https://play.google.com/store/apps/details?id=com.jjdc.djangoadmin
>>
>> [image: Django-admin-1] 
>>  [image: 
>> Django-admin-2.jpg] 
>> 
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbd4f7b2-4ae7-4ac2-b8fe-a7839d3f0d1d%40googlegroups.com.


Re: Django admin application for Android

2019-07-21 Thread Jens-Joris Decorte
Hi Derek,

The GOLD plan is for users who want to manage multiple projects.
On top of that they get some other benefits like using shortcuts and 
rearranging the order of the models.

This is $0.99 per month as a way to support my development :-)

Kind regards

Op woensdag 17 juli 2019 08:11:56 UTC+2 schreef Derek:
>
> Can you explain more about the GOLD plan - what is it and how much does it 
> cost?
>
> On Monday, 15 July 2019 12:51:58 UTC+2, Jens-Joris Decorte wrote:
>>
>> Hello Django developers!
>>
>> Being both a Django developer and a heavy user of Django applications, I 
>> found myself accessing the admin interface of my Django sites quite often 
>> via my smartphone when I am on the road.
>> I was stoked to see the new responsive admin since Django 2.0, which made 
>> this process much smoother.
>>
>> Lately I've been developing an *Android app* to access your site's 
>> admin. It ports the *responsive design to ALL Django versions* and 
>> includes even more features to make the experience very mobile friendly.
>> I have just released this app on the Google Play Store 
>>  so 
>> feel free to check it out or to share it with other Django developer / 
>> users. Any feedback will also be appreciated!
>>
>> The app can be found here: 
>> https://play.google.com/store/apps/details?id=com.jjdc.djangoadmin
>>
>> [image: Django-admin-1] 
>>  [image: 
>> Django-admin-2.jpg] 
>> 
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/be43dd1b-9297-429e-b029-e8c18b2398b9%40googlegroups.com.


Re: Django admin application for Android

2019-07-21 Thread Jens-Joris Decorte
Hi Derek,

The GOLD plan is for users who want to manage multiple projects.
On top of that they get some other benefits like using shortcuts and 
rearranging the order of the models.

This is $0.99 per month as a way to support my development :-)

Kind regards

Op woensdag 17 juli 2019 08:11:56 UTC+2 schreef Derek:
>
> Can you explain more about the GOLD plan - what is it and how much does it 
> cost?
>
> On Monday, 15 July 2019 12:51:58 UTC+2, Jens-Joris Decorte wrote:
>>
>> Hello Django developers!
>>
>> Being both a Django developer and a heavy user of Django applications, I 
>> found myself accessing the admin interface of my Django sites quite often 
>> via my smartphone when I am on the road.
>> I was stoked to see the new responsive admin since Django 2.0, which made 
>> this process much smoother.
>>
>> Lately I've been developing an *Android app* to access your site's 
>> admin. It ports the *responsive design to ALL Django versions* and 
>> includes even more features to make the experience very mobile friendly.
>> I have just released this app on the Google Play Store 
>>  so 
>> feel free to check it out or to share it with other Django developer / 
>> users. Any feedback will also be appreciated!
>>
>> The app can be found here: 
>> https://play.google.com/store/apps/details?id=com.jjdc.djangoadmin
>>
>> [image: Django-admin-1] 
>>  [image: 
>> Django-admin-2.jpg] 
>> 
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56e4363e-85b4-401d-864f-eb14bb559366%40googlegroups.com.


Re: NotImplemented error combining distinct with annotate

2019-07-21 Thread Simon Charette
Assuming you have a model definition `Salesperson` you could use

Salesperson.object.annotate(
sales_amount=Sum('sales__sales_amount'),
)

But given you mentioned 'salesperson' is a text field you can do

persons = Sales.objects.values('salesperson').annotate(
sum_sales_amount=Sum('sales_amount')
)
for person in persons:
print('Salesperson %s sold %d dollars' % (person['salesperson'], 
person['sum_sales_amount'])

Note that .values() before annotating a an aggregation function results in 
a GROUP BY
which should should prefer over using DISTINCT.

Cheers,
Simon

Le dimanche 21 juillet 2019 21:20:37 UTC-4, John Gateley a écrit :
>
> Hello,
>
> Python version: Python 3.7.2
> Django version: 2.2.3
>
> I want to combine distinct and annotate(Sum(...)), and get the following 
> error:
> NotImplementedError: annotate() + distinct(fields) is not implemented.
>
> To describe: I have a bunch of sales entries like:
> 'John', 100
> 'Sam', 50
> 'John', 200
> (the model is a text field for salesperson and an integer field for 
> sales_amount)
>
> I want to write a query like:
> res = Sales.objects.distinct('salesperson').annotate(Sum('sales_amount'))
> for person in res:
> print('Salesperson %s sold %d dollars' % (person.salesperson, 
> person.sales_amount__count))
>
> I would expect:
> Salesperson John sold 300 dollars
> Salesperson Sam sold 50 dollars
>
> Instead it generates the above error. Is there a way to do this?
>
> Thank you,
>
> John
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1f28638f-d43e-41d9-ba43-663d9d05df09%40googlegroups.com.


NotImplemented error combining distinct with annotate

2019-07-21 Thread John Gateley
Hello,

Python version: Python 3.7.2
Django version: 2.2.3

I want to combine distinct and annotate(Sum(...)), and get the following
error:
NotImplementedError: annotate() + distinct(fields) is not implemented.

To describe: I have a bunch of sales entries like:
'John', 100
'Sam', 50
'John', 200
(the model is a text field for salesperson and an integer field for
sales_amount)

I want to write a query like:
res = Sales.objects.distinct('salesperson').annotate(Sum('sales_amount'))
for person in res:
print('Salesperson %s sold %d dollars' % (person.salesperson,
person.sales_amount__count))

I would expect:
Salesperson John sold 300 dollars
Salesperson Sam sold 50 dollars

Instead it generates the above error. Is there a way to do this?

Thank you,

John

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABMyA2MVHvD5ARbw2UGyikkeJsgLDGbsXkBkGRdx-Bd0UbeSeA%40mail.gmail.com.


Re: Usar confirmacion de correo para crear un nuevo usuario ?? ayuda!!! soy nuevo en este framework

2019-07-21 Thread carlos
Hola, este es el grupo de usuario de django en ingles, existe un grupo para
español django...@googlegroups.com.
y para responderte a tu pregunta puedes usar una app de terceros llamada
django-allauth
https://django-allauth.readthedocs.io/en/latest/
ahi en la documentación sale toda la información que necesitas saber para
usarla.

saludos

On Sat, Jul 20, 2019 at 6:03 AM DANIEL URBANO DE LA RUA <
dannybombas...@gmail.com> wrote:

> hay muchos ejemplos en google pero si quieres te paso uno
>
>
> El sáb., 20 jul. 2019 a las 13:31, Alvaro Puerto (<
> alvaroevenor.puertotel...@gmail.com>) escribió:
>
>> Lo que quiero es un ejemplo de como crear un registro con una
>> confirmacion de correo uso django 2.2.2
>> pero no se como empezar?
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/26c0a4ae-4bc8-4b7a-ae3a-d2b431e7dece%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAO_yRT3HGdbG0Xjrg4rY32dK3Gxp%3DrZhemTYjBv2L8ZEoWZihg%40mail.gmail.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO23mO1evATuive%2B9e5Q0kikPsPdeuwQZ3ZmNACq1%2BrhTQ%40mail.gmail.com.


Re: how to convert django application to Windows exe format

2019-07-21 Thread Jonathan May
Pip install pyinstaller and then run “pyinstaller — onefile filename.py”

On Sun, Jul 21, 2019 at 6:01 PM Jonathan May  wrote:

> You can use pyinstaller to convert your py file to exe
>
> On Sun, Jul 21, 2019 at 5:57 PM Mike Dewhirst 
> wrote:
>
>> Try searching for python to exe
>>
>>
>> *Connected by Motorola*
>>
>>
>> Balaji Shetty  wrote:
>>
>> Hi
>>
>> Can anyone please tell me
>> how to convert django application to Windows exe format.
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/c853s6280bnne1mgefv0k317.1563749853389%40email.android.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOYzx0iJrZgg71W%3D1LKPU2evQR5UdLFDX1HdzFPK_NXkU31vjA%40mail.gmail.com.


Re: how to convert django application to Windows exe format

2019-07-21 Thread Jonathan May
You can use pyinstaller to convert your py file to exe

On Sun, Jul 21, 2019 at 5:57 PM Mike Dewhirst  wrote:

> Try searching for python to exe
>
>
> *Connected by Motorola*
>
>
> Balaji Shetty  wrote:
>
> Hi
>
> Can anyone please tell me
> how to convert django application to Windows exe format.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com
> 
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c853s6280bnne1mgefv0k317.1563749853389%40email.android.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOYzx0gnV6kdm7-UrzyMxWDczAywPFO_2fRCW%2Bu%3DNA4n2yutmQ%40mail.gmail.com.


Re: how to convert django application to Windows exe format

2019-07-21 Thread Mike Dewhirst
Try searching for python to exe


Connected by Motorola

Balaji Shetty  wrote:

>Hi
>
>
>Can anyone please tell me 
>
>how to convert django application to Windows exe format.
>
>-- 
>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 view this discussion on the web visit 
>https://groups.google.com/d/msgid/django-users/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c853s6280bnne1mgefv0k317.1563749853389%40email.android.com.


Re: M2M relationship not behaving as I would expect

2019-07-21 Thread Mike Dewhirst
You can constrain uniqueness in the through table and/or the other tables to 
represent whatever real-world constraints you need. Otherwise you can have as 
many duplicated relationships as you want. Each through record has its own id 
so the database is happy no matter how many go in. 

Connected by Motorola

Don Baldwin  wrote:

>Hi,
>
>I have a many-to-many relationship between users and things, where a user can 
>select multiple things,
>and a thing can be selected by multiple users. The relationship between users 
>and things also
>contains data, so I've specifically setup a through table.
>
>When I add a user to a thing, I guess I expect a one-to-one relationship 
>between the thing and
>the intervening bridge, but it seems like I'm getting a one-to-many.
>
>Here is my code:
>
>models.py:
>
>class TestUser(models.Model):
>user_data = models.TextField(default="")
>
>def __str__(self):
>return "Other: " + self.user_data
>
>class TestThing(models.Model):
>thing_data = models.TextField(default="")
>user = models.ManyToManyField(TestUser, through='TestBridge')
>
>def __str__(self):
>return "Thing: " + self.thing_data
>
>class TestBridge(models.Model):
>user = models.ForeignKey(TestUser, on_delete=models.CASCADE)
>thing = models.ForeignKey(TestThing, on_delete=models.CASCADE)
>bridge_data = models.TextField(default="")
>
>def __str__(self):
>return "Bridge: " + self.bridge_data
>
>tests.py:
>
>u_1 = TestUser(user_data = 'user')
>u_1.save()
>t_1 = TestThing(thing_data='thing 1')
>t_1.save()
>t_2 = TestThing(thing_data='thing 2')
>t_2.save()
>
>t_1.user.add(u_1, through_defaults={'bridge_data': 'bridge 1'})
>t_2.user.add(u_1, through_defaults={'bridge_data': 'bridge 2'})
>
>data = list(TestThing.objects.all().values('user__user_data',
>'thing_data',
>'user__testbridge__bridge_data'))
>for item in data:
>print(item)
>
>Output:
>
>{'user__user_data': 'user', 'thing_data': 'thing 1', 
>'user__testbridge__bridge_data': 'bridge 1'}
>{'user__user_data': 'user', 'thing_data': 'thing 1', 
>'user__testbridge__bridge_data': 'bridge 2'}
>{'user__user_data': 'user', 'thing_data': 'thing 2', 
>'user__testbridge__bridge_data': 'bridge 1'}
>{'user__user_data': 'user', 'thing_data': 'thing 2', 
>'user__testbridge__bridge_data': 'bridge 2'}
>
>What I expect:
>
>{'user__user_data': 'user', 'thing_data': 'thing 1', 
>'user__testbridge__bridge_data': 'bridge 1'}
>{'user__user_data': 'user', 'thing_data': 'thing 2', 
>'user__testbridge__bridge_data': 'bridge 2'}
>
>How do I get rid of the relationships between thing 1 and bridge 2, and 
>between thing 2 and bridge 1?Thanks for your responses.-Don
>
>-- 
>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 view this discussion on the web visit 
>https://groups.google.com/d/msgid/django-users/CAKL%3DYPH5OCd9wYNG%2BZ4R0%3DuYOEW0hfhRngqfudeaGqCjB6Yfrg%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/mosb6bo4w6bv3axaaicmqsht.1563749793797%40email.android.com.


how to convert django application to Windows exe format

2019-07-21 Thread Balaji Shetty
Hi

Can anyone please tell me
how to convert django application to Windows exe format.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAECSbOvhEg7kAZU8gwARLU-vkk%3Dx0b4moGf7eSSFb2RrGcruuw%40mail.gmail.com.


M2M relationship not behaving as I would expect

2019-07-21 Thread Don Baldwin
Hi,

I have a many-to-many relationship between users and things, where a
user can select multiple things,
and a thing can be selected by multiple users.  The relationship
between users and things also
contains data, so I've specifically setup a through table.

When I add a user to a thing, I guess I expect a one-to-one
relationship between the thing and
the intervening bridge, but it seems like I'm getting a one-to-many.

Here is my code:

models.py:

class TestUser(models.Model):
user_data = models.TextField(default="")

def __str__(self):
return "Other: " + self.user_data

class TestThing(models.Model):
thing_data = models.TextField(default="")
user = models.ManyToManyField(TestUser, through='TestBridge')

def __str__(self):
return "Thing: " + self.thing_data

class TestBridge(models.Model):
user = models.ForeignKey(TestUser, on_delete=models.CASCADE)
thing = models.ForeignKey(TestThing, on_delete=models.CASCADE)
bridge_data = models.TextField(default="")

def __str__(self):
return "Bridge: " + self.bridge_data

tests.py:

u_1 = TestUser(user_data = 'user')
u_1.save()
t_1 = TestThing(thing_data='thing 1')
t_1.save()
t_2 = TestThing(thing_data='thing 2')
t_2.save()

t_1.user.add(u_1, through_defaults={'bridge_data': 'bridge 1'})
t_2.user.add(u_1, through_defaults={'bridge_data': 'bridge 2'})

data = list(TestThing.objects.all().values('user__user_data',
   'thing_data',

'user__testbridge__bridge_data'))
for item in data:
print(item)

Output:

{'user__user_data': 'user', 'thing_data': 'thing 1',
'user__testbridge__bridge_data': 'bridge 1'}
{'user__user_data': 'user', 'thing_data': 'thing 1',
'user__testbridge__bridge_data': 'bridge 2'}
{'user__user_data': 'user', 'thing_data': 'thing 2',
'user__testbridge__bridge_data': 'bridge 1'}
{'user__user_data': 'user', 'thing_data': 'thing 2',
'user__testbridge__bridge_data': 'bridge 2'}

What I expect:

{'user__user_data': 'user', 'thing_data': 'thing 1',
'user__testbridge__bridge_data': 'bridge 1'}
{'user__user_data': 'user', 'thing_data': 'thing 2',
'user__testbridge__bridge_data': 'bridge 2'}

How do I get rid of the relationships between thing 1 and bridge 2,
and between thing 2 and bridge 1?

Thanks for your responses.

-Don

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKL%3DYPH5OCd9wYNG%2BZ4R0%3DuYOEW0hfhRngqfudeaGqCjB6Yfrg%40mail.gmail.com.