Re: Installing django on python3.5.2. Debian

2016-12-13 Thread Michal Petrucha
On Tue, Dec 13, 2016 at 01:16:52PM -0800, mihail.poplav...@gmail.com wrote:
> Hello! I have a problem with installing Django on python 3.5.2, Debian
> I can't install pip on this version of python. However, python 3.4 has pip.
> How can I install pip in python 3.5.2? 

If you installed Python from apt repositories, then you should almost
never use pip directly, in fact, there's very little reason for you to
have a system-level pip at all.

What you should do is create a virtualenv (either with the
python3-virtualenv package with the command “virtualenv”, or
python3-venv, using “python3 -m venv”). The virtualenv will already
contain a version of pip that you can use, and you're free to mess
with packages inside that virtualenv in whatever way you want.

The reason for this is that if you use pip with your system Python
installed from repositories, there's a high chance that you will
overwrite some of the essential repository-installed packages with
pip, which can render your entire Python installation unusable. This
does happen to people quite often, and it's quite difficult to recover
from.

Good luck,

Michal

-- 
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/20161214075129.GI22986%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: Installing django on python3.5.2. Debian

2016-12-13 Thread Antonis Christofides

Hi,

How did you install Python? Usually pip is installed together with Python. If 
for some reason it hasn't been installed, you should be able to install it with 
"python -m ensurepip". See https://docs.python.org/3/library/ensurepip.html.


Regards,

Antonis Christofides
http://djangodeployment.com

On 12/13/2016 11:16 PM, mihail.poplav...@gmail.com wrote:

Hello! I have a problem with installing Django on python 3.5.2, Debian
I can't install pip on this version of python. However, python 3.4 has pip.
How can I install pip in python 3.5.2?
--
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/11beec53-44d9-464b-953f-dbc8f484beb6%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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/d5ac2063-c4fd-a2c9-c186-d91a54fcb9d2%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Installing django on python3.5.2. Debian

2016-12-13 Thread mihail . poplavkov
Hello! I have a problem with installing Django on python 3.5.2, Debian
I can't install pip on this version of python. However, python 3.4 has pip.
How can I install pip in python 3.5.2? 

-- 
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/11beec53-44d9-464b-953f-dbc8f484beb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Django Browser issue

2016-12-13 Thread Anjali Mk -X (anmk - WIPRO LIMITED at Cisco)
Hi,

Thanks for the reply.
I donno how to connect to manage.py from host server since Django code is not 
placed in that host. Hosting server is connecting to code through wsgi.
Please let me know if you know how to connect then I will try and check.

Regards,
Anjali

[banner7]



Anjali Mk
Engineer - Software
a...@cisco.com
Tel: 8 066 3356

Cisco Systems, Inc.
No: 72 & 73, Keonics Electronics City Hosur Main Road
BANGALORE
560100
India
cisco.com


[http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]Think before you 
print.

This email may contain confidential and privileged material for the sole use of 
the intended recipient. Any review, use, distribution or disclosure by others 
is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete 
all copies of this message.
Please click 
here for 
Company Registration Information.


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Jani Tiainen
Sent: Monday, December 12, 2016 3:17 PM
To: django-users@googlegroups.com
Subject: Re: Django Browser issue


Hi,

Can you also confirm that you can connect from manage.py on hosted server to 
oracle db just fine?

On 12.12.2016 10:53, anjalim...@gmail.com wrote:
Hi,

I am facing a peculiar issue. My application is working fine in all browsers if 
it ran through local host. But when the application is hosted an apache server, 
everything works fine in firefox browser but in other browsers application is 
not connecting to oracle db and the page is shwing empty content.
Please provide me some suggestions to solve this issue.

Thanks in advance,
Anjali

--
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/323689f9-62da-4840-8cef-3af945a8eb6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jani Tiainen
--
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/c6324e5e-57a6-f7f2-e2f9-f3391ae3e2bf%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/ece272b470f04d7fb62c57912c510b26%40XCH-ALN-003.cisco.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with makemigrations on Speedy Composer

2016-12-13 Thread GMail
Well, as far as I know, in Django you need to have abstract base classes for 
models 
(https://docs.djangoproject.com/en/1.10/topics/db/models/#model-inheritance 
).

If I understand your case correctly, NamedEntity and Entity contain some common 
fields/methods, that should be present in all children. So you should make them 
abstract and use them like this:


from django.db import models

class Entity(models.Model):
common_field = models.CharField(max_length=100)  # some common field for 
all children

class Meta:
abstract = True


class CustomEntity(Entity):
custom_field = models.CharField(max_length=100)  # only present in 
CostomEntities

# CustomEntity also has common_field in this example, so you could do that:
ce = CustomEntity(common_field='foo', custom_field='bar')
ce.save()

# But you can't do that with abstract models:
Entity(common_field='baz').save()  # will raise an exception


So in your case there're three abstract models: Entity -> NamedEntity -> 
SpeedyComposerNamedEntity -> (non-abstract models go here)
All abstract models have to have "abstract = True" attribute in their Meta 
classes.

Here's a real life example from my project (I needed created/updated fields for 
some of my models):


from django.db.models import Mode, DateTimeField


class TrackedModel(Model):
created = DateTimeField(auto_now_add=timezone.now)
modified = DateTimeField(auto_now=True)

class Meta:
abstract = True


class Event(TrackedModel):
description = ...
...


To reiterate, abstract models can't be saved like usual ones. So you can't use 
Entity for base class and also to store some data in DB. Probably need another 
level ob abstraction here.

> On 13 Dec 2016, at 19:18, Uri Even-Chen  wrote:
> 
> If I set SpeedyComposerNamedEntity to be abstract (which makes sense, there 
> will not be objects of it), I get this error message:
> 
> peedy\composer>manage.py makemigrations
> SystemCheckError: System check identified some issues:
> 
> ERRORS:
> compose.Composition.accompaniment: (models.E006) The field 'accompaniment' 
> clashes with the field 'accompaniment' from model 'accounts.namedentity'.
> compose.Composition.folder: (models.E006) The field 'folder' clashes with the 
> field 'folder' from model 'accounts.namedentity'.
> compose.Composition.user: (models.E006) The field 'user' clashes with the 
> field 'user' from model 'accounts.entity'.
> compose.Folder.user: (models.E006) The field 'user' clashes with the field 
> 'user' from model 'accounts.entity'.
> 
> And if I set NamedEntity to be abstract, I get this error message:
> 
> speedy\composer>manage.py makemigrations
> SystemCheckError: System check identified some issues:
> 
> ERRORS:
> compose.Composition.accompaniment: (models.E006) The field 'accompaniment' 
> clashes with the field 'accompaniment' from model 'accounts.entity'.
> compose.Composition.folder: (models.E006) The field 'folder' clashes with the 
> field 'folder' from model 'accounts.entity'.
> compose.Composition.user: (models.E006) The field 'user' clashes with the 
> field 'user' from model 'accounts.entity'.
> compose.Folder.user: (models.E006) The field 'user' clashes with the field 
> 'user' from model 'accounts.entity'.
> 
> Entity can't be abstract because it contains all the entities and usernames 
> on the database, it must have a table.
> 
> Thanks,
> Uri.
> 
> 
> Uri Even-Chen   
>   Phone: +972-54-3995700 
> Email: u...@speedy.net 
> Website: http://www.speedysoftware.com/uri/en/ 
> 
>     
>      
> 
> 
> On Tue, Dec 13, 2016 at 5:56 PM, GMail  > wrote:
> Hi!
> 
> First guess - SpeedyComposerNamedEntity is not an abstract model. Meta is not 
> inherited from NamedEntity, you have to do that explicitly:
> 
> class SpeedyComposerNamedEntity(NamedEntity):
> ...
> 
> class Meta(NamedEntity.Meta):
> pass
> 
> ...
> 
> 
>> On 13 Dec 2016, at 18:30, Uri Even-Chen > > wrote:
>> 
>> Dear Django Users,
>> 
>> I'm trying to write the models of Speedy Composer in Django 1.10.4, but I 
>> can't run makemigrations - I get this error message:
>> 
>> speedy\composer>manage.py makemigrations
>> SystemCheckError: System check identified some issues:
>> 
>> ERRORS:
>> compose.Composition.accompaniment: (models.E006) The field 'accompaniment' 
>> clashes with the field 'accompaniment' from model 
>> 'compose.speedycomposernamedentity'.
>> compose.Composition.folder: (models.E006) The field 'folder' clashes with 
>> the field 'folder' from model 

Re: Problem with makemigrations on Speedy Composer

2016-12-13 Thread Uri Even-Chen
If I set SpeedyComposerNamedEntity to be abstract (which makes sense, there
will not be objects of it), I get this error message:

peedy\composer>manage.py makemigrations
SystemCheckError: System check identified some issues:

ERRORS:
compose.Composition.accompaniment: (models.E006) The field 'accompaniment'
clashes with the field 'accompaniment' from model 'accounts.namedentity'.
compose.Composition.folder: (models.E006) The field 'folder' clashes with
the field 'folder' from model 'accounts.namedentity'.
compose.Composition.user: (models.E006) The field 'user' clashes with the
field 'user' from model 'accounts.entity'.
compose.Folder.user: (models.E006) The field 'user' clashes with the field
'user' from model 'accounts.entity'.

And if I set NamedEntity to be abstract, I get this error message:

speedy\composer>manage.py makemigrations
SystemCheckError: System check identified some issues:

ERRORS:
compose.Composition.accompaniment: (models.E006) The field 'accompaniment'
clashes with the field 'accompaniment' from model 'accounts.entity'.
compose.Composition.folder: (models.E006) The field 'folder' clashes with
the field 'folder' from model 'accounts.entity'.
compose.Composition.user: (models.E006) The field 'user' clashes with the
field 'user' from model 'accounts.entity'.
compose.Folder.user: (models.E006) The field 'user' clashes with the field
'user' from model 'accounts.entity'.

Entity can't be abstract because it contains all the entities and usernames
on the database, it must have a table.

Thanks,
Uri.


*Uri Even-Chen*
[image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    


On Tue, Dec 13, 2016 at 5:56 PM, GMail  wrote:

> Hi!
>
> First guess - SpeedyComposerNamedEntity is not an abstract model. Meta is
> not inherited from NamedEntity, you have to do that explicitly:
>
> class SpeedyComposerNamedEntity(NamedEntity):
> ...
>
> class Meta(NamedEntity.Meta):
> pass
>
> ...
>
>
> On 13 Dec 2016, at 18:30, Uri Even-Chen  wrote:
>
> Dear Django Users,
>
> I'm trying to write the models of Speedy Composer in Django 1.10.4, but I
> can't run makemigrations - I get this error message:
>
> speedy\composer>manage.py makemigrations
> SystemCheckError: System check identified some issues:
>
> ERRORS:
> compose.Composition.accompaniment: (models.E006) The field
> 'accompaniment' clashes with the field 'accompaniment' from model 'compose.
> speedycomposernamedentity'.
> compose.Composition.folder: (models.E006) The field 'folder' clashes with
> the field 'folder' from model 'compose.speedycomposernamedentity'.
> compose.Composition.user: (models.E006) The field 'user' clashes with the
> field 'user' from model 'accounts.entity'.
> compose.Folder.user: (models.E006) The field 'user' clashes with the field
> 'user' from model 'accounts.entity'.
>
> This is my new models.py file of my new app, speedy.composer.compose (from
> PyCharm):
>
> from django.conf import settings
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
>
> from speedy.net.accounts.models import NamedEntity
>
>
> class SpeedyComposerNamedEntity(NamedEntity):
> MIN_USERNAME_LENGTH = 1
> MAX_USERNAME_LENGTH = 200
> MIN_SLUG_LENGTH = 1
> MAX_SLUG_LENGTH = 200
> MIN_NAME_LENGTH = 1
> MAX_NAME_LENGTH = 200
>
> def __str__(self):
> return '{}'.format(self.name)
>
>
> class ChordsTemplate(SpeedyComposerNamedEntity):
>
> class Meta:
> verbose_name = _('chords template')
> verbose_name_plural = _('chords templates')
>
>
> class Accompaniment(SpeedyComposerNamedEntity):
>
> class Meta:
> verbose_name = _('accompaniment')
> verbose_name_plural = _('accompaniments')
>
>
> class Folder(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
>
> class Meta:
> verbose_name = _('folder')
> verbose_name_plural = _('folders')
>
>
> class Composition(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
> folder = models.ForeignKey(verbose_name=_('folder'), to=Folder, 
> related_name='+')
> chords_template = models.ForeignKey(verbose_name=_('chords template'), 
> to=ChordsTemplate, related_name='+')
> accompaniment = models.ForeignKey(verbose_name=_('accompaniment'), 
> to=Accompaniment, related_name='+')
> tempo = models.SmallIntegerField(verbose_name=_('tempo'), default=105)
> public = models.BooleanField(verbose_name=_('public'), default=False)
>
> class Meta:
> verbose_name = _('composition')
> verbose_name_plural = _('compositions')
>
> 

Re: Problem with makemigrations on Speedy Composer

2016-12-13 Thread Uri Even-Chen
Why does it have to be abstract? NamedEntity and Entity are also not
abstract.

https://github.com/urievenchen/speedy-net/blob/master/speedy/net/accounts/models.py

Uri.


*Uri Even-Chen*
[image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    


On Tue, Dec 13, 2016 at 5:56 PM, GMail  wrote:

> Hi!
>
> First guess - SpeedyComposerNamedEntity is not an abstract model. Meta is
> not inherited from NamedEntity, you have to do that explicitly:
>
> class SpeedyComposerNamedEntity(NamedEntity):
> ...
>
> class Meta(NamedEntity.Meta):
> pass
>
> ...
>
>
> On 13 Dec 2016, at 18:30, Uri Even-Chen  wrote:
>
> Dear Django Users,
>
> I'm trying to write the models of Speedy Composer in Django 1.10.4, but I
> can't run makemigrations - I get this error message:
>
> speedy\composer>manage.py makemigrations
> SystemCheckError: System check identified some issues:
>
> ERRORS:
> compose.Composition.accompaniment: (models.E006) The field
> 'accompaniment' clashes with the field 'accompaniment' from model 'compose.
> speedycomposernamedentity'.
> compose.Composition.folder: (models.E006) The field 'folder' clashes with
> the field 'folder' from model 'compose.speedycomposernamedentity'.
> compose.Composition.user: (models.E006) The field 'user' clashes with the
> field 'user' from model 'accounts.entity'.
> compose.Folder.user: (models.E006) The field 'user' clashes with the field
> 'user' from model 'accounts.entity'.
>
> This is my new models.py file of my new app, speedy.composer.compose (from
> PyCharm):
>
> from django.conf import settings
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
>
> from speedy.net.accounts.models import NamedEntity
>
>
> class SpeedyComposerNamedEntity(NamedEntity):
> MIN_USERNAME_LENGTH = 1
> MAX_USERNAME_LENGTH = 200
> MIN_SLUG_LENGTH = 1
> MAX_SLUG_LENGTH = 200
> MIN_NAME_LENGTH = 1
> MAX_NAME_LENGTH = 200
>
> def __str__(self):
> return '{}'.format(self.name)
>
>
> class ChordsTemplate(SpeedyComposerNamedEntity):
>
> class Meta:
> verbose_name = _('chords template')
> verbose_name_plural = _('chords templates')
>
>
> class Accompaniment(SpeedyComposerNamedEntity):
>
> class Meta:
> verbose_name = _('accompaniment')
> verbose_name_plural = _('accompaniments')
>
>
> class Folder(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
>
> class Meta:
> verbose_name = _('folder')
> verbose_name_plural = _('folders')
>
>
> class Composition(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
> folder = models.ForeignKey(verbose_name=_('folder'), to=Folder, 
> related_name='+')
> chords_template = models.ForeignKey(verbose_name=_('chords template'), 
> to=ChordsTemplate, related_name='+')
> accompaniment = models.ForeignKey(verbose_name=_('accompaniment'), 
> to=Accompaniment, related_name='+')
> tempo = models.SmallIntegerField(verbose_name=_('tempo'), default=105)
> public = models.BooleanField(verbose_name=_('public'), default=False)
>
> class Meta:
> verbose_name = _('composition')
> verbose_name_plural = _('compositions')
>
> You can see the speedy.net code on GitHub: 
> https://github.com/urievenchen/speedy-net
>
> What did I do wrong? Did I write the models wrongly?
>
> Thanks,
>
> Uri.
>
>  *Uri Even-Chen*
>
> [image: photo] Phone: +972-54-3995700
> Email: u...@speedy.net
> Website: http://www.speedysoftware.com/uri/en/
> 
> 
>   
> 
>
> --
> 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/CAMQ2MsGdLb%2BHXtGF4ss_vDb_fsW%3DHv4e5e%
> 3DUskbBJfzt3CFunw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> 

Re: Problem with makemigrations on Speedy Composer

2016-12-13 Thread GMail
Hi!

First guess - SpeedyComposerNamedEntity is not an abstract model. Meta is not 
inherited from NamedEntity, you have to do that explicitly:

class SpeedyComposerNamedEntity(NamedEntity):
...

class Meta(NamedEntity.Meta):
pass

...


> On 13 Dec 2016, at 18:30, Uri Even-Chen  wrote:
> 
> Dear Django Users,
> 
> I'm trying to write the models of Speedy Composer in Django 1.10.4, but I 
> can't run makemigrations - I get this error message:
> 
> speedy\composer>manage.py makemigrations
> SystemCheckError: System check identified some issues:
> 
> ERRORS:
> compose.Composition.accompaniment: (models.E006) The field 'accompaniment' 
> clashes with the field 'accompaniment' from model 
> 'compose.speedycomposernamedentity'.
> compose.Composition.folder: (models.E006) The field 'folder' clashes with the 
> field 'folder' from model 'compose.speedycomposernamedentity'.
> compose.Composition.user: (models.E006) The field 'user' clashes with the 
> field 'user' from model 'accounts.entity'.
> compose.Folder.user: (models.E006) The field 'user' clashes with the field 
> 'user' from model 'accounts.entity'.
> 
> This is my new models.py file of my new app, speedy.composer.compose (from 
> PyCharm):
> 
> from django.conf import settings
> from django.db import models
> from django.utils.translation import ugettext_lazy as _
> 
> from speedy.net.accounts.models import NamedEntity
> 
> 
> class SpeedyComposerNamedEntity(NamedEntity):
> MIN_USERNAME_LENGTH = 1
> MAX_USERNAME_LENGTH = 200
> MIN_SLUG_LENGTH = 1
> MAX_SLUG_LENGTH = 200
> MIN_NAME_LENGTH = 1
> MAX_NAME_LENGTH = 200
> 
> def __str__(self):
> return '{}'.format(self.name)
> 
> 
> class ChordsTemplate(SpeedyComposerNamedEntity):
> 
> class Meta:
> verbose_name = _('chords template')
> verbose_name_plural = _('chords templates')
> 
> 
> class Accompaniment(SpeedyComposerNamedEntity):
> 
> class Meta:
> verbose_name = _('accompaniment')
> verbose_name_plural = _('accompaniments')
> 
> 
> class Folder(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
> 
> class Meta:
> verbose_name = _('folder')
> verbose_name_plural = _('folders')
> 
> 
> class Composition(SpeedyComposerNamedEntity):
> user = models.ForeignKey(verbose_name=_('user'), 
> to=settings.AUTH_USER_MODEL, related_name='+')
> folder = models.ForeignKey(verbose_name=_('folder'), to=Folder, 
> related_name='+')
> chords_template = models.ForeignKey(verbose_name=_('chords template'), 
> to=ChordsTemplate, related_name='+')
> accompaniment = models.ForeignKey(verbose_name=_('accompaniment'), 
> to=Accompaniment, related_name='+')
> tempo = models.SmallIntegerField(verbose_name=_('tempo'), default=105)
> public = models.BooleanField(verbose_name=_('public'), default=False)
> 
> class Meta:
> verbose_name = _('composition')
> verbose_name_plural = _('compositions')
> 
> You can see the speedy.net  code on GitHub: 
> https://github.com/urievenchen/speedy-net 
> 
> 
> What did I do wrong? Did I write the models wrongly?
> Thanks,
> Uri.
> Uri Even-Chen  
>   Phone: +972-54-3995700 
> Email: u...@speedy.net 
> Website: http://www.speedysoftware.com/uri/en/ 
> 
>     
>      
> 
> 
> -- 
> 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/CAMQ2MsGdLb%2BHXtGF4ss_vDb_fsW%3DHv4e5e%3DUskbBJfzt3CFunw%40mail.gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

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

Problem with makemigrations on Speedy Composer

2016-12-13 Thread Uri Even-Chen
Dear Django Users,

I'm trying to write the models of Speedy Composer in Django 1.10.4, but I
can't run makemigrations - I get this error message:

speedy\composer>manage.py makemigrations
SystemCheckError: System check identified some issues:

ERRORS:
compose.Composition.accompaniment: (models.E006) The field 'accompaniment'
clashes with the field 'accompaniment' from model
'compose.speedycomposernamedentity'.
compose.Composition.folder: (models.E006) The field 'folder' clashes with
the field 'folder' from model 'compose.speedycomposernamedentity'.
compose.Composition.user: (models.E006) The field 'user' clashes with the
field 'user' from model 'accounts.entity'.
compose.Folder.user: (models.E006) The field 'user' clashes with the field
'user' from model 'accounts.entity'.

This is my new models.py file of my new app, speedy.composer.compose (from
PyCharm):

from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _

from speedy.net.accounts.models import NamedEntity


class SpeedyComposerNamedEntity(NamedEntity):
MIN_USERNAME_LENGTH = 1
MAX_USERNAME_LENGTH = 200
MIN_SLUG_LENGTH = 1
MAX_SLUG_LENGTH = 200
MIN_NAME_LENGTH = 1
MAX_NAME_LENGTH = 200

def __str__(self):
return '{}'.format(self.name)


class ChordsTemplate(SpeedyComposerNamedEntity):

class Meta:
verbose_name = _('chords template')
verbose_name_plural = _('chords templates')


class Accompaniment(SpeedyComposerNamedEntity):

class Meta:
verbose_name = _('accompaniment')
verbose_name_plural = _('accompaniments')


class Folder(SpeedyComposerNamedEntity):
user = models.ForeignKey(verbose_name=_('user'),
to=settings.AUTH_USER_MODEL, related_name='+')

class Meta:
verbose_name = _('folder')
verbose_name_plural = _('folders')


class Composition(SpeedyComposerNamedEntity):
user = models.ForeignKey(verbose_name=_('user'),
to=settings.AUTH_USER_MODEL, related_name='+')
folder = models.ForeignKey(verbose_name=_('folder'), to=Folder,
related_name='+')
chords_template = models.ForeignKey(verbose_name=_('chords
template'), to=ChordsTemplate, related_name='+')
accompaniment = models.ForeignKey(verbose_name=_('accompaniment'),
to=Accompaniment, related_name='+')
tempo = models.SmallIntegerField(verbose_name=_('tempo'), default=105)
public = models.BooleanField(verbose_name=_('public'), default=False)

class Meta:
verbose_name = _('composition')
verbose_name_plural = _('compositions')

You can see the speedy.net code on GitHub:
https://github.com/urievenchen/speedy-net

What did I do wrong? Did I write the models wrongly?

Thanks,

Uri.

 *Uri Even-Chen*

[image: photo] Phone: +972-54-3995700
Email: u...@speedy.net
Website: http://www.speedysoftware.com/uri/en/
  
    


-- 
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/CAMQ2MsGdLb%2BHXtGF4ss_vDb_fsW%3DHv4e5e%3DUskbBJfzt3CFunw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: virtualenv is not compatible with this system

2016-12-13 Thread graeme
It looks like you are trying to use virtualenv with Anaconda. I would have 
thought conda is likely to work better with Anaconda (I do not know whether 
virtualenv will work at all with Anaconda, conda is certainly the usual way 
to create virtual environments with Anaconda).

On Tuesday, December 13, 2016 at 6:08:31 PM UTC+5:30, Ravin Kohli wrote:
>
>
> I am trying to create a virtual env on a mac when is execute the following 
> line i get an error saying virtualenv is not compatible with this system
>
> virtualenv env_new
> Using base prefix '/Users/ravinkohli/anaconda3'
> New python executable in /Users/ravinkohli/env_new/bin/python
> dyld: Library not loaded: @rpath/libpython3.5m.dylib
>   Referenced from: /Users/ravinkohli/env_new/bin/python
>   Reason: image not found
> ERROR: The executable /Users/ravinkohli/env_new/bin/python is not functioning
> ERROR: It thinks sys.prefix is '/Users/ravinkohli' (should be 
> '/Users/ravinkohli/env_new')
> ERROR: virtualenv is not compatible with this system or executable
>
>
>
>

-- 
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/82319097-e3c7-4531-855a-69542742dac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Opinions on permissions stategy

2016-12-13 Thread Vinicius Assef
Yes, mptt can save your day.

When handling hierarchies it's important to establish clear priorities.

An example: given the following hierarchy: Project (1st "floor") -> Module
(2nd "floor") -> Task (3rd "floor"), if not directly assigned, a task
should consider module's permission? Or the project's permission should
always rule that situation?

The object's "floor" is important.

--
Vinicius


On Tuesday, 13 December 2016, Avraham Serour  wrote:

> Hi,
>
> Thanks for taking your time on this.
>
> > Could a child object have a different permission from its parent?
> Yes, I'm thinking someone may have access to the parent but not to all
> childs, or read access to the project and write access to some tasks
> (probably the ones I'm responsible)
> So each object has
>
> >  If it doesn't override the parent permission, you should check the
> parent's permission, additionally.
>
> Well, I see two problems here.
> 1 - Currently the system stores only who has access, a lack of it means
> the user has no permission.
> Not so big of a problem, I can change this, so it is a minor problem.
>
> 2 - I don't know the depth level, a task for example may have subtasks,
> which are task objects itself, which may each have subtasks and so on
> I would need to check each in a loop, can't do it in one query.
>
> I'm now thinking that I could use a mptt for this or maybe this would be
> too complicated?
> Using mptt I could have hierarchical permissions and check for permissions
> on an object and each parent if permissions are not defined, but I would
> need to change the way permissions are stored right now to also store
> negative permissions
>
> Avraham
>
>
> On Tue, Dec 13, 2016 at 3:34 AM, Vinicius Assef  > wrote:
>
>> Considerations follow inline...
>>
>> On 11 December 2016 at 03:34, Avraham Serour > > wrote:
>> > ...
>> >
>> > So should I check the parent object permissions? or just checking the
>> > current object is enough?
>>
>> It depends on the granularity level of your permissions.
>>
>> Could a child object have a different permission from its parent? If
>> yes, you only need to check the object itself. If it doesn't override
>> the parent permission, you should check the parent's permission,
>> additionally.
>>
>> Or must it always obey the parent permissions? If that's the case, you
>> only need to check the parent permission.
>>
>> >
>> > I'm thinking of copying the parent permissions when an object is
>> created, in
>> > this way creating an object could be expensive and the permissions
>> table may
>> > get too big, but reading the permissions can be cheap.
>>
>> Or children objects can simply point to the parent to check its
>> permission.
>>
>> You could have a column called `parent_id` in each object. If it is
>> the higher level, it will point to nobody (or to itself. It will
>> depend on your logic). So, each child will point to the parent.
>> Permissions must be checked using `parent_id` for relationship.
>>
>> But, again, it will depend on the granularity of your permissions and
>> how much you want to allow or forbid a child override a parent
>> permission.
>>
>> --
>> Vinicius Assef
>>
>> --
>> 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/ms
>> gid/django-users/CAFmXjSDOybmJ0EfBA1ECv9Mf6MFAtaEx6%
>> 2BrP8XB4x%3D%2BHsOK21Q%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/CAFWa6tK2UFnOwPo_6_VqZSdMnnjV8NxdVfdLsuwvM90OQjif
> hQ%40mail.gmail.com
> 
> .
> For more options, visit 

virtualenv is not compatible with this system

2016-12-13 Thread Ravin Kohli


I am trying to create a virtual env on a mac when is execute the following 
line i get an error saying virtualenv is not compatible with this system

virtualenv env_new
Using base prefix '/Users/ravinkohli/anaconda3'
New python executable in /Users/ravinkohli/env_new/bin/python
dyld: Library not loaded: @rpath/libpython3.5m.dylib
  Referenced from: /Users/ravinkohli/env_new/bin/python
  Reason: image not found
ERROR: The executable /Users/ravinkohli/env_new/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/ravinkohli' (should be 
'/Users/ravinkohli/env_new')
ERROR: virtualenv is not compatible with this system or executable



-- 
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/5b2daf34-c1fb-4937-aa58-4d0a05c6982c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filling out a form using a json file

2016-12-13 Thread jochen . luig
Hello Abraham,

thanks for your answer!

On Mon, 12. Dec 10:15, 'Abraham Varricatt' via Django users 
 wrote:
> What about using the forms validate() method? i.e. if the user has not 
> filled in all the JSON details, return a validation error. This should give 
> them the opportunity to make edits or re-type as needed.

Yes, I probably should validate the input that way, but what I'm
concerned with at the moment is how the JSON details make it to the
form object in the first place.
I probably got overwhelmed reading the API Docs and thought there has
to be a more elegant way to handle the JSON -> Form Object part than
just writing a ``post`` method.
 
> > On another note, there are several Models I want to work with in 
> > this way so it would be even better if I could select the model 
> > class according to the contents of the json file. 
> >
> 
> This sounds like a validation job to me. Just put in all the logic checks 
> into the validate() method. Bear in mind that you are likely to receive bad 
> input, so handle accordingly. 

As in validating the ModelForms for each object and choose the one
that validates successfully if any?

Jochen

-- 
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/20161213081852.GA12521%40gmail.com.
For more options, visit https://groups.google.com/d/optout.