librelist archives

« back to archive

Making reference to a specific user

Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-20 @ 22:20
How do I make a reference to a specific user in geonode specifically in the
django administration portion?


Thanks

Re: [geonode] Making reference to a specific user

From:
Jeffrey Johnson
Date:
2011-11-20 @ 22:24
Kerrisha,

Are you making your own new model class? Not exactly sure what you are
trying to do, but if you can provide more detail, we are happy to help
you figure it out.

Jeff

On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
<kerrisha.nelson@gmail.com> wrote:
> How do I make a reference to a specific user in geonode specifically in the
> django administration portion?
>
> Thanks

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-20 @ 22:48
I am editing the upload/data section of GeoNode. I want only the system
administration to upload data to GeoNode. I want to create a code in the
uploadhandler.py to allow a specfic user to upload. If any other user want
to upload, they will not be able to. Therefore, I need a python syntax that
will refer to a specific username.

On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org>wrote:

> Kerrisha,
>
> Are you making your own new model class? Not exactly sure what you are
> trying to do, but if you can provide more detail, we are happy to help
> you figure it out.
>
> Jeff
>
> On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
> <kerrisha.nelson@gmail.com> wrote:
> > How do I make a reference to a specific user in geonode specifically in
> the
> > django administration portion?
> >
> > Thanks
>

Re: [geonode] Making reference to a specific user

From:
Reinier Battenberg
Date:
2011-11-21 @ 14:57
Just a noob question, but cant this be done by assigning the right permissions 
to that user? (or even create a group with this permission and adding this 
user to that group?)

Coding security like this does not look right.

rgds,
reinier


> I am editing the upload/data section of GeoNode. I want only the system
> administration to upload data to GeoNode. I want to create a code in the
> uploadhandler.py to allow a specfic user to upload. If any other user want
> to upload, they will not be able to. Therefore, I need a python syntax that
> will refer to a specific username.
> 
> On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson 
<jjohnson@opengeo.org>wrote:
> 
> > Kerrisha,
> >
> > Are you making your own new model class? Not exactly sure what you are
> > trying to do, but if you can provide more detail, we are happy to help
> > you figure it out.
> >
> > Jeff
> >
> > On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
> > <kerrisha.nelson@gmail.com> wrote:
> > > How do I make a reference to a specific user in geonode specifically in
> > the
> > > django administration portion?
> > >
> > > Thanks
> >
> 
-- 
rgds,

Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
http://twitter.com/batje
http://twitter.com/mapuganda

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-21 @ 15:18
The permissions to actually prevent users from uploading layers is not
available. The layers I'[m speaking about is on the upload data form. I
wanted to block it then add a permssion "can upload data". I was not
getting through with that so I had another idea to block all users except
one user to upload data. If you can give me help, I'll appreciate it.


On Mon, Nov 21, 2011 at 10:57 AM, Reinier Battenberg <
reinier.battenberg@mountbatten.net> wrote:

> **
>
>
> Just a noob question, but cant this be done by assigning the right
> permissions to that user? (or even create a group with this permission and
> adding this user to that group?)
>
>
> Coding security like this does not look right.
>
>
> rgds,
>
> reinier
>
>
>
> > I am editing the upload/data section of GeoNode. I want only the system
>
> > administration to upload data to GeoNode. I want to create a code in the
>
> > uploadhandler.py to allow a specfic user to upload. If any other user
> want
>
> > to upload, they will not be able to. Therefore, I need a python syntax
> that
>
> > will refer to a specific username.
>
> >
>
> > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org
> >wrote:
>
> >
>
> > > Kerrisha,
>
> > >
>
> > > Are you making your own new model class? Not exactly sure what you are
>
> > > trying to do, but if you can provide more detail, we are happy to help
>
> > > you figure it out.
>
> > >
>
> > > Jeff
>
> > >
>
> > > On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
>
> > > <kerrisha.nelson@gmail.com> wrote:
>
> > > > How do I make a reference to a specific user in geonode specifically
> in
>
> > > the
>
> > > > django administration portion?
>
> > > >
>
> > > > Thanks
>
> > >
>
> >
>
> --
>
> rgds,
>
>
> Reinier Battenberg
>
> Director
>
> Mountbatten Ltd.
>
> +256 758 801 749
>
> www.mountbatten.net
>
> http://twitter.com/batje
>
> http://twitter.com/mapuganda
>
>
>
>
>

Re: [geonode] Making reference to a specific user

From:
Reinier Battenberg
Date:
2011-11-21 @ 15:37
(the noob remark is totally true. i have no clue how django works.)

when i go to the admin section of the site, i can click a user and under 
permissions i can then scroll down and see a permission with the descriptive 
name of

maps | layer | Can add layer

Can't hurt to experiment with that.

rgds,

reinier

> The permissions to actually prevent users from uploading layers is not
> available. The layers I'[m speaking about is on the upload data form. I
> wanted to block it then add a permssion "can upload data". I was not
> getting through with that so I had another idea to block all users except
> one user to upload data. If you can give me help, I'll appreciate it.
> 
> 
> On Mon, Nov 21, 2011 at 10:57 AM, Reinier Battenberg <
> reinier.battenberg@mountbatten.net> wrote:
> 
> > **
> >
> >
> > Just a noob question, but cant this be done by assigning the right
> > permissions to that user? (or even create a group with this permission and
> > adding this user to that group?)
> >
> >
> > Coding security like this does not look right.
> >
> >
> > rgds,
> >
> > reinier
> >
> >
> >
> > > I am editing the upload/data section of GeoNode. I want only the system
> >
> > > administration to upload data to GeoNode. I want to create a code in the
> >
> > > uploadhandler.py to allow a specfic user to upload. If any other user
> > want
> >
> > > to upload, they will not be able to. Therefore, I need a python syntax
> > that
> >
> > > will refer to a specific username.
> >
> > >
> >
> > > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org
> > >wrote:
> >
> > >
> >
> > > > Kerrisha,
> >
> > > >
> >
> > > > Are you making your own new model class? Not exactly sure what you are
> >
> > > > trying to do, but if you can provide more detail, we are happy to help
> >
> > > > you figure it out.
> >
> > > >
> >
> > > > Jeff
> >
> > > >
> >
> > > > On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
> >
> > > > <kerrisha.nelson@gmail.com> wrote:
> >
> > > > > How do I make a reference to a specific user in geonode specifically
> > in
> >
> > > > the
> >
> > > > > django administration portion?
> >
> > > > >
> >
> > > > > Thanks
> >
> > > >
> >
> > >
> >
> > --
> >
> > rgds,
> >
> >
> > Reinier Battenberg
> >
> > Director
> >
> > Mountbatten Ltd.
> >
> > +256 758 801 749
> >
> > www.mountbatten.net
> >
> > http://twitter.com/batje
> >
> > http://twitter.com/mapuganda
> >
> >
> >
> >
> >
> 
-- 
rgds,

Reinier Battenberg
Director
Mountbatten Ltd.
+256 758 801 749
www.mountbatten.net
http://twitter.com/batje
http://twitter.com/mapuganda

Re: [geonode] Making reference to a specific user

From:
Ariel Nunez
Date:
2011-11-21 @ 15:30
Kerrisha,

We could help you if you give us more data than:

"I was not getting through with that"

I am sure you can appreciate how hard it is to suggest a fix without
knowing what went wrong or error messages.

-a

On Mon, Nov 21, 2011 at 10:18 AM, Kerrisha Nelson <kerrisha.nelson@gmail.com
> wrote:

> The permissions to actually prevent users from uploading layers is not
> available. The layers I'[m speaking about is on the upload data form. I
> wanted to block it then add a permssion "can upload data". I was not
> getting through with that so I had another idea to block all users except
> one user to upload data. If you can give me help, I'll appreciate it.
>
>
>
> On Mon, Nov 21, 2011 at 10:57 AM, Reinier Battenberg <
> reinier.battenberg@mountbatten.net> wrote:
>
>> **
>>
>>
>> Just a noob question, but cant this be done by assigning the right
>> permissions to that user? (or even create a group with this permission and
>> adding this user to that group?)
>>
>>
>> Coding security like this does not look right.
>>
>>
>> rgds,
>>
>> reinier
>>
>>
>>
>> > I am editing the upload/data section of GeoNode. I want only the system
>>
>> > administration to upload data to GeoNode. I want to create a code in the
>>
>> > uploadhandler.py to allow a specfic user to upload. If any other user
>> want
>>
>> > to upload, they will not be able to. Therefore, I need a python syntax
>> that
>>
>> > will refer to a specific username.
>>
>> >
>>
>> > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org
>> >wrote:
>>
>> >
>>
>> > > Kerrisha,
>>
>> > >
>>
>> > > Are you making your own new model class? Not exactly sure what you are
>>
>> > > trying to do, but if you can provide more detail, we are happy to help
>>
>> > > you figure it out.
>>
>> > >
>>
>> > > Jeff
>>
>> > >
>>
>> > > On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
>>
>> > > <kerrisha.nelson@gmail.com> wrote:
>>
>> > > > How do I make a reference to a specific user in geonode
>> specifically in
>>
>> > > the
>>
>> > > > django administration portion?
>>
>> > > >
>>
>> > > > Thanks
>>
>> > >
>>
>> >
>>
>> --
>>
>> rgds,
>>
>>
>> Reinier Battenberg
>>
>> Director
>>
>> Mountbatten Ltd.
>>
>> +256 758 801 749
>>
>> www.mountbatten.net
>>
>> http://twitter.com/batje
>>
>> http://twitter.com/mapuganda
>>
>>
>>
>>
>>
>

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-21 @ 16:04
On Mon, Nov 21, 2011 at 11:30 AM, Ariel Nunez <ingenieroariel@gmail.com>wrote:

> Kerrisha,
>
> We could help you if you give us more data than:
>
> "I was not getting through with that"
>
> I am sure you can appreciate how hard it is to suggest a fix without
> knowing what went wrong or error messages.
>
> -a
>
>
> On Mon, Nov 21, 2011 at 10:18 AM, Kerrisha Nelson <
> kerrisha.nelson@gmail.com> wrote:
>
>> The permissions to actually prevent users from uploading layers is not
>> available. The layers I'[m speaking about is on the upload data form. I
>> wanted to block it then add a permssion "can upload data". I was not
>> getting through with that so I had another idea to block all users except
>> one user to upload data. If you can give me help, I'll appreciate it.
>>
>>
>>
>> On Mon, Nov 21, 2011 at 10:57 AM, Reinier Battenberg <
>> reinier.battenberg@mountbatten.net> wrote:
>>
>>> **
>>>
>>>
>>> Just a noob question, but cant this be done by assigning the right
>>> permissions to that user? (or even create a group with this permission and
>>> adding this user to that group?)
>>>
>>>
>>> Coding security like this does not look right.
>>>
>>>
>>> rgds,
>>>
>>> reinier
>>>
>>>
>>>
>>> > I am editing the upload/data section of GeoNode. I want only the system
>>>
>>> > administration to upload data to GeoNode. I want to create a code in
>>> the
>>>
>>> > uploadhandler.py to allow a specfic user to upload. If any other user
>>> want
>>>
>>> > to upload, they will not be able to. Therefore, I need a python syntax
>>> that
>>>
>>> > will refer to a specific username.
>>>
>>> >
>>>
>>> > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org
>>> >wrote:
>>>
>>> >
>>>
>>> > > Kerrisha,
>>>
>>> > >
>>>
>>> > > Are you making your own new model class? Not exactly sure what you
>>> are
>>>
>>> > > trying to do, but if you can provide more detail, we are happy to
>>> help
>>>
>>> > > you figure it out.
>>>
>>> > >
>>>
>>> > > Jeff
>>>
>>> > >
>>>
>>> > > On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
>>>
>>> > > <kerrisha.nelson@gmail.com> wrote:
>>>
>>> > > > How do I make a reference to a specific user in geonode
>>> specifically in
>>>
>>> > > the
>>>
>>> > > > django administration portion?
>>>
>>> > > >
>>>
>>> > > > Thanks
>>>
>>> > >
>>>
>>> >
>>>
>>> --
>>>
>>> rgds,
>>>
>>>
>>> Reinier Battenberg
>>>
>>> Director
>>>
>>> Mountbatten Ltd.
>>>
>>> +256 758 801 749
>>>
>>> www.mountbatten.net
>>>
>>> http://twitter.com/batje
>>>
>>> http://twitter.com/mapuganda
>>>
>>>
>>>
>>>
>>>
>>
>

Re: [geonode] Making reference to a specific user

From:
Jeffrey Johnson
Date:
2011-11-20 @ 23:04
User.objects.get(***) or User.objects.filter(***)[0] replacing the ***
with the criteria you want to use to return the specific user you
want.

Jeff

On Mon, Nov 21, 2011 at 9:48 AM, Kerrisha Nelson
<kerrisha.nelson@gmail.com> wrote:
> I am editing the upload/data section of GeoNode. I want only the system
> administration to upload data to GeoNode. I want to create a code in the
> uploadhandler.py to allow a specfic user to upload. If any other user want
> to upload, they will not be able to. Therefore, I need a python syntax that
> will refer to a specific username.
>
> On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org>
> wrote:
>>
>> Kerrisha,
>>
>> Are you making your own new model class? Not exactly sure what you are
>> trying to do, but if you can provide more detail, we are happy to help
>> you figure it out.
>>
>> Jeff
>>
>> On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
>> <kerrisha.nelson@gmail.com> wrote:
>> > How do I make a reference to a specific user in geonode specifically in
>> > the
>> > django administration portion?
>> >
>> > Thanks
>
>

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-21 @ 16:04
How exactly do I write the code for this. Is it like this

if User.objects.get('specific_username')


I'm not sure of what you mean by the criteria within the get() function.

thanks for your help.








On Sun, Nov 20, 2011 at 7:04 PM, Jeffrey Johnson <jjohnson@opengeo.org>wrote:

> User.objects.get(***) or User.objects.filter(***)[0] replacing the ***
> with the criteria you want to use to return the specific user you
> want.
>
> Jeff
>
> On Mon, Nov 21, 2011 at 9:48 AM, Kerrisha Nelson
> <kerrisha.nelson@gmail.com> wrote:
> > I am editing the upload/data section of GeoNode. I want only the system
> > administration to upload data to GeoNode. I want to create a code in the
> > uploadhandler.py to allow a specfic user to upload. If any other user
> want
> > to upload, they will not be able to. Therefore, I need a python syntax
> that
> > will refer to a specific username.
> >
> > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org>
> > wrote:
> >>
> >> Kerrisha,
> >>
> >> Are you making your own new model class? Not exactly sure what you are
> >> trying to do, but if you can provide more detail, we are happy to help
> >> you figure it out.
> >>
> >> Jeff
> >>
> >> On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
> >> <kerrisha.nelson@gmail.com> wrote:
> >> > How do I make a reference to a specific user in geonode specifically
> in
> >> > the
> >> > django administration portion?
> >> >
> >> > Thanks
> >
> >
>

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-21 @ 14:47
if self.activated:
        self.file.write(raw_data)
    else:
        return raw_data

This is part of the uploadhadler.py in geonode/Django files. I am getting
an error that says "return outside function in Line 183." can you please
help me with this python syntax error.




On Sun, Nov 20, 2011 at 7:04 PM, Jeffrey Johnson <jjohnson@opengeo.org>wrote:

> User.objects.get(***) or User.objects.filter(***)[0] replacing the ***
> with the criteria you want to use to return the specific user you
> want.
>
> Jeff
>
> On Mon, Nov 21, 2011 at 9:48 AM, Kerrisha Nelson
> <kerrisha.nelson@gmail.com> wrote:
> > I am editing the upload/data section of GeoNode. I want only the system
> > administration to upload data to GeoNode. I want to create a code in the
> > uploadhandler.py to allow a specfic user to upload. If any other user
> want
> > to upload, they will not be able to. Therefore, I need a python syntax
> that
> > will refer to a specific username.
> >
> > On Sun, Nov 20, 2011 at 6:24 PM, Jeffrey Johnson <jjohnson@opengeo.org>
> > wrote:
> >>
> >> Kerrisha,
> >>
> >> Are you making your own new model class? Not exactly sure what you are
> >> trying to do, but if you can provide more detail, we are happy to help
> >> you figure it out.
> >>
> >> Jeff
> >>
> >> On Mon, Nov 21, 2011 at 9:20 AM, Kerrisha Nelson
> >> <kerrisha.nelson@gmail.com> wrote:
> >> > How do I make a reference to a specific user in geonode specifically
> in
> >> > the
> >> > django administration portion?
> >> >
> >> > Thanks
> >
> >
>

Re: [geonode] Making reference to a specific user

From:
Ariel Nunez
Date:
2011-11-21 @ 14:56
it should be:

if self.activated:
    self.file.write(raw_data)
else:
    return raw_data

(notice the else is at the same level of the if)

On Mon, Nov 21, 2011 at 9:47 AM, Kerrisha Nelson
<kerrisha.nelson@gmail.com>wrote:

> if self.activated:
>         self.file.write(raw_data)
>     else:
>         return raw_data
>

Re: [geonode] Making reference to a specific user

From:
Kerrisha Nelson
Date:
2011-11-21 @ 15:02
Oh that was my mistake with copy and pasting. That's how the code is
written in the python shell. Just like the way you have it but it's still
giving me that same error.

On Mon, Nov 21, 2011 at 10:56 AM, Ariel Nunez <ingenieroariel@gmail.com>wrote:

> it should be:
>
> if self.activated:
>     self.file.write(raw_data)
> else:
>     return raw_data
>
> (notice the else is at the same level of the if)
>
>
> On Mon, Nov 21, 2011 at 9:47 AM, Kerrisha Nelson <
> kerrisha.nelson@gmail.com> wrote:
>
>> if self.activated:
>>         self.file.write(raw_data)
>>     else:
>>         return raw_data
>>
>
>

Re: [geonode] Making reference to a specific user

From:
Ariel Nunez
Date:
2011-11-21 @ 15:05
Kerrisha, in  that case I recommend you to share the complete file (or
function) in something like https://gist.github.com/

Without context it is harder to help you.

-a

On Mon, Nov 21, 2011 at 10:02 AM, Kerrisha Nelson <kerrisha.nelson@gmail.com
> wrote:

> Oh that was my mistake with copy and pasting. That's how the code is
> written in the python shell. Just like the way you have it but it's still
> giving me that same error.
>
>
> On Mon, Nov 21, 2011 at 10:56 AM, Ariel Nunez <ingenieroariel@gmail.com>wrote:
>
>> it should be:
>>
>> if self.activated:
>>     self.file.write(raw_data)
>> else:
>>     return raw_data
>>
>> (notice the else is at the same level of the if)
>>
>>
>> On Mon, Nov 21, 2011 at 9:47 AM, Kerrisha Nelson <
>> kerrisha.nelson@gmail.com> wrote:
>>
>>> if self.activated:
>>>         self.file.write(raw_data)
>>>     else:
>>>         return raw_data
>>>
>>
>>
>