Re: Creating subusers

2014-07-02 Thread Mike Dewhirst

On 2/07/2014 3:16 PM, Lachlan Musicman wrote:

I would recommend Intermediate Models as a good solution for these
type of weird situations

https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships


+1



Cheers
L.

On 2 July 2014 12:20, Jorge Andrés Vergara Ebratt  wrote:

Hello everyone,

I'm trying to create a system that has 3 different user types:

Independent Agent, that basically is what it sounds like, and Django's User
Model works fine for this one.

But the catch comes from the other 2, because it also needs to support
agencies and agencies have sub-users...

I'm trying to figure out the best way to do this, currently I'm trying with
User profiles but don't really know if what I'm doing is correct, I'm doing
this:


class IndependentAgent(models.Model):
 user = models.OneToOneField(User)
 tipo_licencia = models.CharField(max_lenght=140)


class AgencyUser(models.Model):
 user = models.OneToOneField(User)
 agency = models.ForeignKey(User, related_name='Agency')


Can I do this? Like that user profile for Agency User would let me 'asign'
those users to their respective agencies so that later I can set my code
that those users can only see that agency's information?

Or would making groups be better to handle this kind of situations?

Appreciate any help I can get, thanks in advance


--
Jorge Andres Vergara Ebratt
#SoftwareDeveloper (Or at least trying to be)
@javebratt
facebook.com/javebratt

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAAeX05Gc6gnjdDi%3Dv%2B-n72mSi1JWdO1ecYUQORogvMifAw5o7w%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B3ADE0.8060604%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Multiple projects on one server

2014-07-02 Thread Andrew Pashkin

Hi all!

Does anybody had experience in managing deployment of two  or 
moredifferent projects on one system? I have such task and main issue 
that Im experiencing is configuration an dependencies clashes.


Best solution which I have is to make common deployment config for all 
projects, but this is looks ugly.


--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pash...@gmx.co.uk

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B3BEC4.5050803%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-02 Thread ngangsia akumbo
i do the installation, create the virtualenv, startproject, startapp, 
create models, activate admin, 

i still confuse with one thing, if i randomly create this apps how do i 
present them on the html page

That is where my prob is

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/672a0fde-7804-4652-a18d-05d2a80610d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-02 Thread Sithembewena Lloyd Dube
Did you complete the entire tutorial?


On Wed, Jul 2, 2014 at 10:14 AM, ngangsia akumbo  wrote:

> i do the installation, create the virtualenv, startproject, startapp,
> create models, activate admin,
>
> i still confuse with one thing, if i randomly create this apps how do i
> present them on the html page
>
> That is where my prob is
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/672a0fde-7804-4652-a18d-05d2a80610d0%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCA8Lm7XF_Tpwo1%3DYXN5rygErXmNFK93bi8MhXgw%3DD8sUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-02 Thread ngangsia akumbo
no i did not 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a94a48b6-5e9a-4a7d-bd96-0b5941b86758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple projects on one server

2014-07-02 Thread Andrew Pashkin
Sorry, I wrote to wrong mailing list (facepalm.jpg). But actually the 
topic is relevant to django-users too =)

On 02.07.2014 12:11, Andrew Pashkin wrote:

Hi all!

Does anybody had experience in managing deployment of two  or 
moredifferent projects on one system? I have such task and main issue 
that Im experiencing is configuration an dependencies clashes.


Best solution which I have is to make common deployment config for all 
projects, but this is looks ugly.




--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pash...@gmx.co.uk

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B3C192.9030702%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-02 Thread Sithembewena Lloyd Dube
I suggest you do so. It is important to understand how the framework works
before attempting to create your own projects or even using existing apps.


On Wed, Jul 2, 2014 at 10:21 AM, ngangsia akumbo  wrote:

> no i did not
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a94a48b6-5e9a-4a7d-bd96-0b5941b86758%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCD%3DZY_Afg6LKFfVBN9zrC8rAbvH-8Yo7yMU7%2BpL2%3DjQ%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating subusers

2014-07-02 Thread Jorge Andrés Vergara Ebratt
Hey Lachlan, I read the docs you sent me and I have a question, what if (in
that example from the docs that uses Person, Group and Membership) I needed
the Group class to be an user too? Like the Group was an user that can
create, update and delete every user in itself and also all the information
those users wirte to the DB... Would it still be a good approach and create
a 'superuser' member of the group that can have those permissions? Or
should I try something else like groups or extending BaseUser?


2014-07-02 0:16 GMT-05:00 Lachlan Musicman :

> I would recommend Intermediate Models as a good solution for these
> type of weird situations
>
>
> https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships
>
> Cheers
> L.
>
> On 2 July 2014 12:20, Jorge Andrés Vergara Ebratt 
> wrote:
> > Hello everyone,
> >
> > I'm trying to create a system that has 3 different user types:
> >
> > Independent Agent, that basically is what it sounds like, and Django's
> User
> > Model works fine for this one.
> >
> > But the catch comes from the other 2, because it also needs to support
> > agencies and agencies have sub-users...
> >
> > I'm trying to figure out the best way to do this, currently I'm trying
> with
> > User profiles but don't really know if what I'm doing is correct, I'm
> doing
> > this:
> >
> >
> > class IndependentAgent(models.Model):
> > user = models.OneToOneField(User)
> > tipo_licencia = models.CharField(max_lenght=140)
> >
> >
> > class AgencyUser(models.Model):
> > user = models.OneToOneField(User)
> > agency = models.ForeignKey(User, related_name='Agency')
> >
> >
> > Can I do this? Like that user profile for Agency User would let me
> 'asign'
> > those users to their respective agencies so that later I can set my code
> > that those users can only see that agency's information?
> >
> > Or would making groups be better to handle this kind of situations?
> >
> > Appreciate any help I can get, thanks in advance
> >
> >
> > --
> > Jorge Andres Vergara Ebratt
> > #SoftwareDeveloper (Or at least trying to be)
> > @javebratt
> > facebook.com/javebratt
> >
> > --
> > 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.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CAAeX05Gc6gnjdDi%3Dv%2B-n72mSi1JWdO1ecYUQORogvMifAw5o7w%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
>
> ---
> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGBeqiPXRxw7t6qMdPNH_ECGwnK8DZrP7S1-5uzsoC3%2BtsNq5g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Jorge Andres Vergara Ebratt*
*#SoftwareDeveloper (Or at least trying to be)*
*@javebratt*
*facebook.com/javebratt *

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAeX05Ew%2B%3DQ6CgLqtpVcwuvGs%3DQ7n0fNamthsSnT1MRxfrR0Aw%40mail.gmail.com.
For 

Re: django beginner

2014-07-02 Thread ngangsia akumbo


On Wednesday, July 2, 2014 9:47:08 AM UTC+1, Lloyd Dube wrote:
>
> I suggest you do so. It is important to understand how the framework works 
> before attempting to create your own projects or even using existing apps.
>
> Page not found (404)
> Request Method:GET
> Request URL:http://127.0.0.1:8000/articles/year
> Using the URLconf defined in mysite.urls, Django tried these URL patterns, 
> in this order:
> ^articles/(\d{4})/$
> ^articles/(\d{4})/(\d{2})/$
> ^articles/(\d{4})/(\d{2})/(\d+)/$
> ^admin/
> The current URL, articles/year, didn't match any of these.
> You're seeing this error because you have DEBUG = True in your Django 
> settings file. Change that to False, and Django will display a standard 404 
> page.
>


I keep having this prob 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/50e3f958-f1f3-4330-837a-41269b432549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple projects on one server

2014-07-02 Thread Lachlan Musicman
I do it using 3 different virtualenvs, each w their own Django install
(prod, stage, dev).

To facilitate the settings I use the Two Scoops of Django by @pydanny (and
his partner whose name escapes me just now) method which I highly recommend
as a post-tutorial text in general.

But if they are different projects, virtualenv is your friend.

L.
On 02/07/2014 6:12 pm, "Andrew Pashkin"  wrote:

> Hi all!
>
> Does anybody had experience in managing deployment of two  or
> moredifferent projects on one system? I have such task and main issue that
> Im experiencing is configuration an dependencies clashes.
>
> Best solution which I have is to make common deployment config for all
> projects, but this is looks ugly.
>
> --
> With kind regards, Andrew Pashkin.
> cell phone - +7 (985) 898 57 59
> Skype - waves_in_fluids
> e-mail - andrew.pash...@gmx.co.uk
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/53B3BEC4.5050803%40gmx.co.uk.
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiMsNQ2P9K6J4Gts0nr4Ru14MUOtDGxOKVBHaJpO%2BsevNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


User related objects

2014-07-02 Thread Jonathan Querubina
Hi guys,

I need to  customize my admin to show only the data related to the user who 
inserted.

Example: When a user log in, the admin shows only the posts inserted by this 
user.

AFAIK, django only set permissions my model, not by objects.

Is there a way (or a pip package) to implement this?

Thanks!


 Att//

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-02 Thread Lachlan Musicman
You need a ^articles/year/$ in your urls.py if you want to visit
http://127.0.0.1:8000/articles/year/

Your URLs are looking for:

http://127.0.0.1:8000/articles/  - eg http://127.0.0.1:8000/articles/2014
http://127.0.0.1:8000/articles//dd/ - eg
http://127.0.0.1:8000/articles/2014/07/
http://127.0.0.1:8000/articles//dd/{digits}  - eg
http://127.0.0.1:8000/articles/2014/07/02

There is no http://127.0.0.1:8000/articles/year/ in that list.

Cheers
L.

On 2 July 2014 21:01, ngangsia akumbo  wrote:
>
>
> On Wednesday, July 2, 2014 9:47:08 AM UTC+1, Lloyd Dube wrote:
>>
>> I suggest you do so. It is important to understand how the framework works
>> before attempting to create your own projects or even using existing apps.
>>
>> Page not found (404)
>> Request Method:GET
>> Request URL:http://127.0.0.1:8000/articles/year
>> Using the URLconf defined in mysite.urls, Django tried these URL patterns,
>> in this order:
>> ^articles/(\d{4})/$
>> ^articles/(\d{4})/(\d{2})/$
>> ^articles/(\d{4})/(\d{2})/(\d+)/$
>> ^admin/
>> The current URL, articles/year, didn't match any of these.
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard 404
>> page.
>
>
>
> I keep having this prob
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/50e3f958-f1f3-4330-837a-41269b432549%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiPiA81tWCZnjC9fQx3Oo_%2BvcCBFd2FaWqznyYPGsgE8aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: User related objects

2014-07-02 Thread Lachlan Musicman
There are a couple of ways to do it, filtered queries are the obvious solution

https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters

But it would require that your model have either a group or owner
permission set.

(eg
class MyModel(models.Model):
   permission_level = ForeignKey(PermissionGroup)
or
   owner = ForeignKey(User)
)

This has some good examples too

http://www.django-rest-framework.org/api-guide/permissions


cheers
L.


On 2 July 2014 21:21, Jonathan Querubina  wrote:
> Hi guys,
>
> I need to  customize my admin to show only the data related to the user who
> inserted.
>
> Example: When a user log in, the admin shows only the posts inserted by this
> user.
>
> AFAIK, django only set permissions my model, not by objects.
>
> Is there a way (or a pip package) to implement this?
>
> Thanks!
>
>
>  Att//
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating subusers

2014-07-02 Thread Lachlan Musicman
Ah, ok, I see your problem is different - the Intermediate object
probably isn't your friend.

You can try the various levels of User, with various subclasses...

http://www.django-rest-framework.org/api-guide/permissions

Has some good ideas.

cheers
L.

On 2 July 2014 19:52, Jorge Andrés Vergara Ebratt  wrote:
> Hey Lachlan, I read the docs you sent me and I have a question, what if (in
> that example from the docs that uses Person, Group and Membership) I needed
> the Group class to be an user too? Like the Group was an user that can
> create, update and delete every user in itself and also all the information
> those users wirte to the DB... Would it still be a good approach and create
> a 'superuser' member of the group that can have those permissions? Or should
> I try something else like groups or extending BaseUser?
>
>
> 2014-07-02 0:16 GMT-05:00 Lachlan Musicman :
>>
>> I would recommend Intermediate Models as a good solution for these
>> type of weird situations
>>
>>
>> https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships
>>
>> Cheers
>> L.
>>
>> On 2 July 2014 12:20, Jorge Andrés Vergara Ebratt 
>> wrote:
>> > Hello everyone,
>> >
>> > I'm trying to create a system that has 3 different user types:
>> >
>> > Independent Agent, that basically is what it sounds like, and Django's
>> > User
>> > Model works fine for this one.
>> >
>> > But the catch comes from the other 2, because it also needs to support
>> > agencies and agencies have sub-users...
>> >
>> > I'm trying to figure out the best way to do this, currently I'm trying
>> > with
>> > User profiles but don't really know if what I'm doing is correct, I'm
>> > doing
>> > this:
>> >
>> >
>> > class IndependentAgent(models.Model):
>> > user = models.OneToOneField(User)
>> > tipo_licencia = models.CharField(max_lenght=140)
>> >
>> >
>> > class AgencyUser(models.Model):
>> > user = models.OneToOneField(User)
>> > agency = models.ForeignKey(User, related_name='Agency')
>> >
>> >
>> > Can I do this? Like that user profile for Agency User would let me
>> > 'asign'
>> > those users to their respective agencies so that later I can set my code
>> > that those users can only see that agency's information?
>> >
>> > Or would making groups be better to handle this kind of situations?
>> >
>> > Appreciate any help I can get, thanks in advance
>> >
>> >
>> > --
>> > Jorge Andres Vergara Ebratt
>> > #SoftwareDeveloper (Or at least trying to be)
>> > @javebratt
>> > facebook.com/javebratt
>> >
>> > --
>> > 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.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/django-users/CAAeX05Gc6gnjdDi%3Dv%2B-n72mSi1JWdO1ecYUQORogvMifAw5o7w%40mail.gmail.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> The idea is that a beautiful image is frameable. Everything you need
>> to see is there: It’s everything you want, and it’s very pleasing
>> because there’s no extra information that you don’t get to see.
>> Everything’s in a nice package for you. But sublime art is
>> unframeable: It’s an image or idea that implies that there’s a bigger
>> image or idea that you can’t see: You’re only getting to look at a
>> fraction of it, and in that way it’s both beautiful and scary, because
>> it’s reminding you that there’s more that you don’t have access to.
>> It’s now sort of left the piece itself and it’s become your own
>> invention, so it’s personal as well as being scary as well as being
>> beautiful, which is what I really like about art like that.
>>
>> ---
>> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGBeqiPXRxw7t6qMdPNH_ECGwnK8DZrP7S1-5uzsoC3%2BtsNq5g%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Jorge Andres Vergara Ebratt
> #SoftwareDeveloper (Or at least trying to be)
> @javebratt
> facebook.com/javebratt
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To u

Re: User related objects

2014-07-02 Thread Jonathan Querubina
Is there a way to set the ForeignKey(User) or ForeignKey(PermissionGroup) 
automatically by the logged user?

On Jul 2, 2014, at 8:31 AM, Lachlan Musicman  wrote:

> There are a couple of ways to do it, filtered queries are the obvious solution
> 
> https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters
> 
> But it would require that your model have either a group or owner
> permission set.
> 
> (eg
> class MyModel(models.Model):
>   permission_level = ForeignKey(PermissionGroup)
> or
>   owner = ForeignKey(User)
> )
> 
> This has some good examples too
> 
> http://www.django-rest-framework.org/api-guide/permissions
> 
> 
> cheers
> L.
> 
> 
> On 2 July 2014 21:21, Jonathan Querubina  wrote:
>> Hi guys,
>> 
>> I need to  customize my admin to show only the data related to the user who
>> inserted.
>> 
>> Example: When a user log in, the admin shows only the posts inserted by this
>> user.
>> 
>> AFAIK, django only set permissions my model, not by objects.
>> 
>> Is there a way (or a pip package) to implement this?
>> 
>> Thanks!
>> 
>> 
>>  Att//
>> 
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
> ---
> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E662808C-4910-4113-9270-1351D3765AE4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: User related objects

2014-07-02 Thread Jonathan Querubina
My problem is doing this on django-admin.

Thanks!

On Jul 2, 2014, at 8:31 AM, Lachlan Musicman  wrote:

> There are a couple of ways to do it, filtered queries are the obvious solution
> 
> https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters
> 
> But it would require that your model have either a group or owner
> permission set.
> 
> (eg
> class MyModel(models.Model):
>   permission_level = ForeignKey(PermissionGroup)
> or
>   owner = ForeignKey(User)
> )
> 
> This has some good examples too
> 
> http://www.django-rest-framework.org/api-guide/permissions
> 
> 
> cheers
> L.
> 
> 
> On 2 July 2014 21:21, Jonathan Querubina  wrote:
>> Hi guys,
>> 
>> I need to  customize my admin to show only the data related to the user who
>> inserted.
>> 
>> Example: When a user log in, the admin shows only the posts inserted by this
>> user.
>> 
>> AFAIK, django only set permissions my model, not by objects.
>> 
>> Is there a way (or a pip package) to implement this?
>> 
>> Thanks!
>> 
>> 
>>  Att//
>> 
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> -- 
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
> ---
> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7F5940A4-31FF-474D-AC18-2430B3688213%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: User related objects

2014-07-02 Thread Lachlan Musicman
This is what you are after:

https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model

cheers
L.

On 2 July 2014 21:42, Jonathan Querubina  wrote:
> My problem is doing this on django-admin.
>
> Thanks!
>
> On Jul 2, 2014, at 8:31 AM, Lachlan Musicman  wrote:
>
>> There are a couple of ways to do it, filtered queries are the obvious 
>> solution
>>
>> https://docs.djangoproject.com/en/1.6/topics/db/queries/#retrieving-specific-objects-with-filters
>>
>> But it would require that your model have either a group or owner
>> permission set.
>>
>> (eg
>> class MyModel(models.Model):
>>   permission_level = ForeignKey(PermissionGroup)
>> or
>>   owner = ForeignKey(User)
>> )
>>
>> This has some good examples too
>>
>> http://www.django-rest-framework.org/api-guide/permissions
>>
>>
>> cheers
>> L.
>>
>>
>> On 2 July 2014 21:21, Jonathan Querubina  wrote:
>>> Hi guys,
>>>
>>> I need to  customize my admin to show only the data related to the user who
>>> inserted.
>>>
>>> Example: When a user log in, the admin shows only the posts inserted by this
>>> user.
>>>
>>> AFAIK, django only set permissions my model, not by objects.
>>>
>>> Is there a way (or a pip package) to implement this?
>>>
>>> Thanks!
>>>
>>>
>>>  Att//
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/E151B4A3-E3F3-4E26-9342-85E5212C2241%40gmail.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> The idea is that a beautiful image is frameable. Everything you need
>> to see is there: It’s everything you want, and it’s very pleasing
>> because there’s no extra information that you don’t get to see.
>> Everything’s in a nice package for you. But sublime art is
>> unframeable: It’s an image or idea that implies that there’s a bigger
>> image or idea that you can’t see: You’re only getting to look at a
>> fraction of it, and in that way it’s both beautiful and scary, because
>> it’s reminding you that there’s more that you don’t have access to.
>> It’s now sort of left the piece itself and it’s become your own
>> invention, so it’s personal as well as being scary as well as being
>> beautiful, which is what I really like about art like that.
>> ---
>> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGBeqiM%2B5Eb8LxUv8N7cW7st8jesJ8Ec-m0wMj8WJAi3JC1YwA%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/7F5940A4-31FF-474D-AC18-2430B3688213%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Dj

Re: Returning submitted formset data to the template for further editing

2014-07-02 Thread Andrew Choi

Daniele,

Are you processing the formset on one page or on multiple? If multiple, 
then it seems that you don't need a formset and can just chain the form 
inputs into the next form.


For a single page, the first thing that comes to mind is doing the 
processing client-side, via Javascript and AJAX calls. This would only 
be feasible if the information that you're using to process does not 
need to be secret. Then again, writing a client-side data processor 
might be just as much work as writing formset validation code from scratch.


Andrew

On 07/02/2014 03:58 PM, Daniele Procida wrote:

On Sat, Jun 28, 2014, Andrew Choi  wrote:


It doesn't seem like there's an easier way to do what you're proposing.
However, what's the form data manipulation that you need to do for some of
these forms? Is there a way to separate that from the form set submission?

Each time the form is resubmitted to have the data processed, it needs to 
complete some fields based on others, and related data in the database.

Daniele



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B3FCA5.6060001%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Multiple projects on one server

2014-07-02 Thread Ilya Kazakevich
Hello,


Do you have different versions of python or libs? Use virtual env.



Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"


>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com] On Behalf Of Andrew Pashkin
>Sent: Wednesday, July 02, 2014 12:24 PM
>To: Django Users
>Subject: Re: Multiple projects on one server
>
>Sorry, I wrote to wrong mailing list (facepalm.jpg). But actually the topic
is
>relevant to django-users too =) On 02.07.2014 12:11, Andrew Pashkin wrote:
>> Hi all!
>>
>> Does anybody had experience in managing deployment of two  or
>> moredifferent projects on one system? I have such task and main issue
>> that Im experiencing is configuration an dependencies clashes.
>>
>> Best solution which I have is to make common deployment config for all
>> projects, but this is looks ugly.
>>
>
>--
>With kind regards, Andrew Pashkin.
>cell phone - +7 (985) 898 57 59
>Skype - waves_in_fluids
>e-mail - andrew.pash...@gmx.co.uk
>
>--
>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.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/53B3C192.9030702%40gmx.c
>o.uk.
>For more options, visit https://groups.google.com/d/optout.
>
>
>-
>No virus found in this message.
>Checked by AVG - www.avg.com
>Version: 2014.0.4592 / Virus Database: 3986/7780 - Release Date: 07/02/14
>
>-
>No virus found in this message.
>Checked by AVG - www.avg.com
>Version: 2014.0.4592 / Virus Database: 3986/7770 - Release Date: 06/30/14

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/00a101cf95fb%24f755d0c0%24e6017240%24%40JetBrains.com.
For more options, visit https://groups.google.com/d/optout.


django 1.7 upgrade + tastypie -> AppRegistryNotReady

2014-07-02 Thread Frank Bieniek

Hi all,
does currently anybody upgrade his
django 1.6 projects with south and tastypie to the new django1.7

Resources definition of Tastypie collids with the new app registry loading.

I do want to upgrade the project to django 1.7
but I can not replace the whole rest api app -
"an upgrade fork idea" would be great.

Thats the problem:
class MyResource(ModelResource):
...
class Meta:
   queryset = AnyModel.objects.all()

Some models just hit the AppRegistryNotReady Exception...

Any Ideas/Hints/Magic are welcome

Thanks
Frank

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B41BB0.307%40produktlaunch.de.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 upgrade + tastypie -> AppRegistryNotReady

2014-07-02 Thread Tom Evans
On Wed, Jul 2, 2014 at 3:48 PM, Frank Bieniek
 wrote:
> Hi all,
> does currently anybody upgrade his
> django 1.6 projects with south and tastypie to the new django1.7
>
> Resources definition of Tastypie collids with the new app registry loading.
>
> I do want to upgrade the project to django 1.7
> but I can not replace the whole rest api app -
> "an upgrade fork idea" would be great.
>
> Thats the problem:
> class MyResource(ModelResource):
> ...
> class Meta:
>queryset = AnyModel.objects.all()
>
> Some models just hit the AppRegistryNotReady Exception...
>
> Any Ideas/Hints/Magic are welcome
>
> Thanks
> Frank
>

Four options (and these are basically the same for any third party
library you use)

1) Wait for Tastypie developers to add support for Django 1.7 to a
release, using 1.6 in the meantime
2) Add support for Django 1.7 to Tastypie and send the patch to
Tastypie developers
3) Hire someone to do 2)
4) Work around the issue if possible

Tastypie is a very popular framework, so I would expect them to have a
release out that supports Django 1.7 soon after Django 1.7 is actually
released.

As a work around, can you give a callable as the "queryset" attribute
on your resource meta class?

Cheers

Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1KMQuBR3e7Vdp0Xqc7CumyWE5w81G%2BQqF9OOf1UQDD4DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Question about static file serving strategy with S3 and Cloudfront

2014-07-02 Thread Chen Xu
Hi Everyone,

I am currently using the following strategy to serve my static files,
basically I run collectstatic to copy all my files to my static files
directory, and then move it to s3, and cloudfront will pick it up from
there. However, I wonder if I set the cache period to be 1 day in my
cloudfront, and I upload new updated files to s3, are the files still going
to be the old ones until next time the cache expires?


Thanks

-- 
⚡ Chen Xu ⚡

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


Re: Question about static file serving strategy with S3 and Cloudfront

2014-07-02 Thread Cal Leeming [Simplicity Media Ltd]
You also have to consider client side caching, despite if you use the
correct headers or not.

One option is to use a cache buster using a value which changes on each
release, but I'd advise against using random() cache buster as your caching
efficiency will be impacted.

//example.com/static/images.jpg?release=1000
//example.com/static/images.jpg?release=1001

Cal


On Wed, Jul 2, 2014 at 7:08 PM, Chen Xu  wrote:

> Hi Everyone,
>
> I am currently using the following strategy to serve my static files,
> basically I run collectstatic to copy all my files to my static files
> directory, and then move it to s3, and cloudfront will pick it up from
> there. However, I wonder if I set the cache period to be 1 day in my
> cloudfront, and I upload new updated files to s3, are the files still going
> to be the old ones until next time the cache expires?
>
>
> Thanks
>
> --
> ⚡ Chen Xu ⚡
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACac-qYBa0Pg0eYQfoVGNTk2jHXC2Y100-xkHAo0AA7%2Bk3cw_w%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFLDZigvNmwdM_GvHnpamuj4Ro0gvVoNyfUbA_kemXa8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.7 upgrade + tastypie -> AppRegistryNotReady

2014-07-02 Thread Frank Bieniek

Thanks Tom for the 4 evergreen options.

Tastypies currently does not allow to deferr it to a callable,
it accesses a property on the queryset...
https://github.com/toastdriven/django-tastypie/blob/master/tastypie/resources.py#L1712

As I do not understand the new app registry and how a normal django 
model form can,
deferr their meta model handling, I was looking for some hints for 
building a workaround.


Thanks
Frank


Am 02.07.14 18:12, schrieb Tom Evans:

On Wed, Jul 2, 2014 at 3:48 PM, Frank Bieniek
 wrote:

Hi all,
does currently anybody upgrade his
django 1.6 projects with south and tastypie to the new django1.7

Resources definition of Tastypie collids with the new app registry loading.

I do want to upgrade the project to django 1.7
but I can not replace the whole rest api app -
"an upgrade fork idea" would be great.

Thats the problem:
class MyResource(ModelResource):
 ...
 class Meta:
queryset = AnyModel.objects.all()

Some models just hit the AppRegistryNotReady Exception...

Any Ideas/Hints/Magic are welcome

Thanks
Frank


Four options (and these are basically the same for any third party
library you use)

1) Wait for Tastypie developers to add support for Django 1.7 to a
release, using 1.6 in the meantime
2) Add support for Django 1.7 to Tastypie and send the patch to
Tastypie developers
3) Hire someone to do 2)
4) Work around the issue if possible

Tastypie is a very popular framework, so I would expect them to have a
release out that supports Django 1.7 soon after Django 1.7 is actually
released.

As a work around, can you give a callable as the "queryset" attribute
on your resource meta class?

Cheers

Tom



--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53B47C1F.7060508%40produktlaunch.de.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple projects on one server

2014-07-02 Thread Lachlan Musicman
Absolutely. Can't speak to different versions of python, although you
could always hard code that in the virtenv itself, but as for libs -
absolutely. In reality most distros (well, deb based) come with python
2 and python 3 and there are packages available if you need an older
version than 2.7.

http://virtualenv.readthedocs.org/en/latest/virtualenv.html

On 2 July 2014 23:46, Ilya Kazakevich  wrote:
> Hello,
>
>
> Do you have different versions of python or libs? Use virtual env.
>
>
>
> Ilya Kazakevich,
> JetBrains PyCharm (Best Python/Django IDE)
> http://www.jetbrains.com/pycharm/
> "Develop with pleasure!"
>
>
>>-Original Message-
>>From: django-users@googlegroups.com
>>[mailto:django-users@googlegroups.com] On Behalf Of Andrew Pashkin
>>Sent: Wednesday, July 02, 2014 12:24 PM
>>To: Django Users
>>Subject: Re: Multiple projects on one server
>>
>>Sorry, I wrote to wrong mailing list (facepalm.jpg). But actually the topic
> is
>>relevant to django-users too =) On 02.07.2014 12:11, Andrew Pashkin wrote:
>>> Hi all!
>>>
>>> Does anybody had experience in managing deployment of two  or
>>> moredifferent projects on one system? I have such task and main issue
>>> that Im experiencing is configuration an dependencies clashes.
>>>
>>> Best solution which I have is to make common deployment config for all
>>> projects, but this is looks ugly.
>>>
>>
>>--
>>With kind regards, Andrew Pashkin.
>>cell phone - +7 (985) 898 57 59
>>Skype - waves_in_fluids
>>e-mail - andrew.pash...@gmx.co.uk
>>
>>--
>>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.
>>To view this discussion on the web visit
>>https://groups.google.com/d/msgid/django-users/53B3C192.9030702%40gmx.c
>>o.uk.
>>For more options, visit https://groups.google.com/d/optout.
>>
>>
>>-
>>No virus found in this message.
>>Checked by AVG - www.avg.com
>>Version: 2014.0.4592 / Virus Database: 3986/7780 - Release Date: 07/02/14
>>
>>-
>>No virus found in this message.
>>Checked by AVG - www.avg.com
>>Version: 2014.0.4592 / Virus Database: 3986/7770 - Release Date: 06/30/14
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/00a101cf95fb%24f755d0c0%24e6017240%24%40JetBrains.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGBeqiPTSiC64uZOASG7ZP%3DoT0RVv9G8P63OeH-M3JDthK0eSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple projects on one server

2014-07-02 Thread Jorge Andrés Vergara Ebratt
The different versions of python do work, I have 2 current projects right
now running on the same machine and one uses Python 2.7.x and the otherone
uses Python 3.2

You just have to use the -p flag when creating the virtualenv:

virtualenv -p /usr/bin/pythonVersion venv


I use a venv folder to collect all the files so that they don't mix with my
projects code, but that's really a personal preference


2014-07-02 17:04 GMT-05:00 Lachlan Musicman :

> Absolutely. Can't speak to different versions of python, although you
> could always hard code that in the virtenv itself, but as for libs -
> absolutely. In reality most distros (well, deb based) come with python
> 2 and python 3 and there are packages available if you need an older
> version than 2.7.
>
> http://virtualenv.readthedocs.org/en/latest/virtualenv.html
>
> On 2 July 2014 23:46, Ilya Kazakevich 
> wrote:
> > Hello,
> >
> >
> > Do you have different versions of python or libs? Use virtual env.
> >
> >
> >
> > Ilya Kazakevich,
> > JetBrains PyCharm (Best Python/Django IDE)
> > http://www.jetbrains.com/pycharm/
> > "Develop with pleasure!"
> >
> >
> >>-Original Message-
> >>From: django-users@googlegroups.com
> >>[mailto:django-users@googlegroups.com] On Behalf Of Andrew Pashkin
> >>Sent: Wednesday, July 02, 2014 12:24 PM
> >>To: Django Users
> >>Subject: Re: Multiple projects on one server
> >>
> >>Sorry, I wrote to wrong mailing list (facepalm.jpg). But actually the
> topic
> > is
> >>relevant to django-users too =) On 02.07.2014 12:11, Andrew Pashkin
> wrote:
> >>> Hi all!
> >>>
> >>> Does anybody had experience in managing deployment of two  or
> >>> moredifferent projects on one system? I have such task and main issue
> >>> that Im experiencing is configuration an dependencies clashes.
> >>>
> >>> Best solution which I have is to make common deployment config for all
> >>> projects, but this is looks ugly.
> >>>
> >>
> >>--
> >>With kind regards, Andrew Pashkin.
> >>cell phone - +7 (985) 898 57 59
> >>Skype - waves_in_fluids
> >>e-mail - andrew.pash...@gmx.co.uk
> >>
> >>--
> >>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.
> >>To view this discussion on the web visit
> >>https://groups.google.com/d/msgid/django-users/53B3C192.9030702%40gmx.c
> >>o.uk.
> >>For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>-
> >>No virus found in this message.
> >>Checked by AVG - www.avg.com
> >>Version: 2014.0.4592 / Virus Database: 3986/7780 - Release Date: 07/02/14
> >>
> >>-
> >>No virus found in this message.
> >>Checked by AVG - www.avg.com
> >>Version: 2014.0.4592 / Virus Database: 3986/7770 - Release Date: 06/30/14
> >
> > --
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/00a101cf95fb%24f755d0c0%24e6017240%24%40JetBrains.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
>
> ---
> Adventure Time http://theholenearthecenteroftheworld.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGBeqiPTSiC6

Remote development on Heroku

2014-07-02 Thread Malik Rumi
Because I have not been able to get a response to this issue 

 I 
am going to use for remote development. Since I will not be giving out the 
url,will it be okay to set debug to true and use debug toolbar?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b416bcf0-bf8b-49ba-8055-979b9b879322%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.