Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Noob questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ray Wang  
View profile  
 More options Dec 16 2010, 11:38 am
From: Ray Wang <raycornellw...@gmail.com>
Date: Thu, 16 Dec 2010 08:38:22 -0800 (PST)
Local: Thurs, Dec 16 2010 11:38 am
Subject: Noob questions
Hi,

I've just gotten started with Pinax and it has some great features out
of the box.

I had a couple question on non-design related things:

1.) While I found overriding templates intuitive and easy. I was
wondering how you would override things such as models.py and
views.py. For example, if I want to extend the the profile module to
add fields such as profession and age, how would I do it in the
existing framework?

2.) Is there anyway to have all the pinax modules be copied to my app
and run from there instead of a pinax directory? I find it's adds
extra work to refer to the pinax file system to find a template name
and override it in my app instead of directly editing it.

Thanks a lot,
Ray


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt M  
View profile  
 More options Dec 16 2010, 1:36 pm
From: Matt M <slackbabb...@gmail.com>
Date: Thu, 16 Dec 2010 10:36:32 -0800
Local: Thurs, Dec 16 2010 1:36 pm
Subject: Re: [pinax-users] Noob questions

 "For example, if I want to extend the the profile module to
add fields such as profession and age, how would I do it in the
existing framework?"

Google "Django get_profile"
That should lead you in the right direction.
Basically you create a new model for profession, age, etc... Have a foreign
key pointing back to the User model. Then you retrieve the extended data in
your views/templates with get_profile


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Tauber  
View profile  
 More options Dec 16 2010, 1:57 pm
From: James Tauber <jtau...@jtauber.com>
Date: Thu, 16 Dec 2010 13:57:30 -0500
Local: Thurs, Dec 16 2010 1:57 pm
Subject: Re: [pinax-users] Noob questions

On Dec 16, 2010, at 11:38 AM, Ray Wang wrote:

> Hi,

> I've just gotten started with Pinax and it has some great features out
> of the box.

> I had a couple question on non-design related things:

> 1.) While I found overriding templates intuitive and easy. I was
> wondering how you would override things such as models.py and
> views.py. For example, if I want to extend the the profile module to
> add fields such as profession and age, how would I do it in the
> existing framework?

Take a look at idios:

https://github.com/eldarion/idios

> 2.) Is there anyway to have all the pinax modules be copied to my app
> and run from there instead of a pinax directory? I find it's adds
> extra work to refer to the pinax file system to find a template name
> and override it in my app instead of directly editing it.

I'm confused whether you're talking about the modules or the templates (you seem to start off talking about one then switch to the other)

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt M  
View profile  
 More options Dec 16 2010, 2:02 pm
From: Matt M <slackbabb...@gmail.com>
Date: Thu, 16 Dec 2010 11:02:40 -0800
Local: Thurs, Dec 16 2010 2:02 pm
Subject: Re: [pinax-users] Noob questions

I believe you can see this in action in pinax by looking at the profile
model in pinax.
Just follow what is happening there.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Wang  
View profile  
 More options Dec 16 2010, 5:08 pm
From: Ray Wang <raycornellw...@gmail.com>
Date: Thu, 16 Dec 2010 14:08:40 -0800 (PST)
Local: Thurs, Dec 16 2010 5:08 pm
Subject: Re: Noob questions
Hi,

Thank you Matt and James for replying so fast.

I'm also new to django and I'm afraid I might have used the wrong
terminology:

-I basically want to add the age, profession fields to the existing
pinax Profile App. If I want to override a template file for Profile,
I can create a corresponding file for it in the $PROJECT_ROOT/template
folder, but the same doesn't seem to apply for models.py under the
$PROJECT_ROOT/app/profile/model.py. I was wondering how to override
just that one file in an App.

I took a look at edios and it seems like it would solve my problem.
But that was a generic case which I want to apply to other Pinax apps.
For example, also overriding status update or swap etc.

After googling more on, I found this: http://www.markus-gattol.name/ws/python_web.html#sec11

"Overriding build-in Pinax Applications
Assuming we want to override $PINAX_ROOT/apps/blog with $PROJECT_ROOT/
apps/blog we can do so simply by copying the application and make our
project-local (read individual) changes to it. Pinax will then load
$PROJECT_ROOT/apps/blog rather than $PINAX_ROOT/apps/blog.
Those who do not care about merging in upstream changes nor submitting
bugfixes/features upstream would just issue cp -a $PINAX_ROOT/apps/
blog $PROJECT_ROOT/apps and be done. Those who consider themselves
good FLOSS-country citizens however care about contributing back as
well ..."

I was wondering if that method is a good way to do it (?)

-For my second question. I actually mean is there a way to copy all
the pinax code (app/ and template/) into my django app like how a
normal django app would be structured instead of externally linking. I
think the above solution might also work in that regard.

Sorry for the long email.

Thanks!
Ray

On Dec 16, 2:02 pm, Matt M <slackbabb...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Tauber  
View profile  
 More options Dec 16 2010, 7:17 pm
From: James Tauber <jtau...@jtauber.com>
Date: Thu, 16 Dec 2010 19:17:09 -0500
Local: Thurs, Dec 16 2010 7:17 pm
Subject: Re: [pinax-users] Re: Noob questions

On Dec 16, 2010, at 5:08 PM, Ray Wang wrote:

> Hi,

> Thank you Matt and James for replying so fast.

> I'm also new to django and I'm afraid I might have used the wrong
> terminology:

> -I basically want to add the age, profession fields to the existing
> pinax Profile App. If I want to override a template file for Profile,
> I can create a corresponding file for it in the $PROJECT_ROOT/template
> folder, but the same doesn't seem to apply for models.py under the
> $PROJECT_ROOT/app/profile/model.py. I was wondering how to override
> just that one file in an App.

Individual app files don't work the same way as templates in that regard. The entire app package has to be overridden. Although, in many cases the app will support some level of customization without you having to write your own app.

> I took a look at edios and it seems like it would solve my problem.

The way idios approaches the problem is you write your own profile model (you don't override anything) but you subclass ProfileBase so idios can provide a lot of the generic profile-like capability for you.

> But that was a generic case which I want to apply to other Pinax apps.
> For example, also overriding status update or swap etc.

To the extent that you can't customize via templates or via whatever mechanisms the app provides, you'd need to write your own app.

> After googling more on, I found this: http://www.markus-gattol.name/ws/python_web.html#sec11

> "Overriding build-in Pinax Applications
> Assuming we want to override $PINAX_ROOT/apps/blog with $PROJECT_ROOT/
> apps/blog we can do so simply by copying the application and make our
> project-local (read individual) changes to it. Pinax will then load
> $PROJECT_ROOT/apps/blog rather than $PINAX_ROOT/apps/blog.
> Those who do not care about merging in upstream changes nor submitting
> bugfixes/features upstream would just issue cp -a $PINAX_ROOT/apps/
> blog $PROJECT_ROOT/apps and be done. Those who consider themselves
> good FLOSS-country citizens however care about contributing back as
> well ..."

> I was wondering if that method is a good way to do it (?)

Well, as that article says, if you want to be a good open source citizen, don't do it that way. It's fine, though, if you don't plan to share your customizations back to the community and if you're find not being able to get new updates for that app.

> -For my second question. I actually mean is there a way to copy all
> the pinax code (app/ and template/) into my django app like how a
> normal django app would be structured instead of externally linking. I
> think the above solution might also work in that regard.

You can certainly copy it, just using cp -r or equivalent. But again, that has the caveat that you can't easily share your customizations nor be able to get updates for the app you've copied.

James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ray Wang  
View profile  
 More options Dec 17 2010, 10:17 am
From: Ray Wang <raycornellw...@gmail.com>
Date: Fri, 17 Dec 2010 07:17:11 -0800 (PST)
Local: Fri, Dec 17 2010 10:17 am
Subject: Re: Noob questions
Thank you James for the answers! I'll keep them in mind and only
override locally when necessary.

Ray

On Dec 16, 7:17 pm, James Tauber <jtau...@jtauber.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »