Do you modify third party code used in your projects?

43 views
Skip to first unread message

Peter Dermott

unread,
Nov 3, 2016, 5:19:27 AM11/3/16
to Django users

I'm currently working on my first Django app after years of working with WordPress and right now I'm feeling a little lost so please be gentle.


I'm using the Mezzanine / Cartridge combo to set up an online store for the company I'm working with, so far I've been extending the base cartridge models and overriding templates to do what I need (adding extra fields, different types of product variations etc) but over the last few days there have been a couple of instances where I've hit brick walls.


The first is using the SagePay payment processor. The SagePay docs aren't really aimed at django or python and the django-payments app I've been looking at wants to use its own form in order to accept the card details. The Cartridge form system is a little confusing to me and it doesn't appear to be too friendly to messing with it.


The second is something even simpler where I just want to adjust the way that product variations are output in the cart, again though the forms system was getting in the way so I've resorted to a pretty disgusting hack to get it to do what I need.


So, to the question...Would it be OK just to clone the Cartridge app in my project and make all the overrides I need there? Would this cause massive pain when new releases comes out? Are there any other potential drawbacks I should be aware of and what is considered the best practice with this?

Antonis Christofides

unread,
Nov 3, 2016, 5:45:43 AM11/3/16
to django...@googlegroups.com

Hello,

In such cases, I try to contribute my fixes to the third-party project.

If this is not possible (or until it is done), rather than copy the third party code in my project and go through the hassle of having to maintain it, I prefer monkey-patching, especially if there are only a few fixes.

http://stackoverflow.com/a/6647776/662345

Regards,
Antonis
Antonis Christofides
http://djangodeployment.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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0ccd2679-2639-44fc-8277-dba72fe46102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Melvyn Sopacua

unread,
Nov 3, 2016, 7:48:20 AM11/3/16
to django...@googlegroups.com
On Thursday 03 November 2016 02:11:16 Peter Dermott wrote:

> I'm using the Mezzanine / Cartridge combo to set up an online store
> for the company I'm working with, so far I've been extending the base
> cartridge models and overriding templates to do what I need (adding
> extra fields, different types of product variations etc) but over the
> last few days there have been a couple of instances where I've hit
> brick walls.

Specifically for Mezzanine/Cartridge, the support is excellent. If you
present a real world case they will either point you to the solution or
try to come up with a solution in their code.
I usually judge responsiveness to tickets to see whether this is a
viable avenue to pursue with 3rd-party apps.

> The first is using the SagePay payment processor. The SagePay docs
> aren't really aimed at django or python and the django-payments app
> I've been looking at wants to use its own form in order to accept the
> card details. The Cartridge form system is a little confusing to me
> and it doesn't appear to be too friendly to messing with it.

I have some (albeit limited) experience with SagePay. If you start a
different thread detailing specifics, I might be able to help you along.
But - it is in Cartridge's best interest to support as many payment
providers as possible, so I'd definitely try the Cartridge mailing list
for this one.

Also, it's in *your* best interest to understand the Cartridge form
system. Have you looked at:

<http://cartridge.jupo.org/integration.html#checkout-form>

Remember that in the end it is a Django ModelForm.

> The second is something even simpler where I just want to adjust the
> way that product variations are output in the cart, again though the
> forms system was getting in the way so I've resorted to a pretty
> disgusting hack to get it to do what I need.

In theory, you should be looking at the template to alter output and
only at the form when you need to provide extra information to render
that output.

> So, to the question...Would it be OK just to clone the Cartridge app
> in my project and make all the overrides I need there? Would this
> cause massive pain when new releases comes out? Are there any other
> potential drawbacks I should be aware of and what is considered the
> best practice with this?

I only use this approach as a temporary measure and use a versioning
system to accomplish the task so that with each new release I can see
what is still different with my version from the official one. Ideally,
this does not become a permanent branch in the repository.

When I need to summarize it, I'd say this is my approach:

1. Verify if I'm fixing the problem in the right object / application
layer.
2. Check author(s) responsiveness to tickets
3. Decide whether to keep this app or look for a different one
4. Submit problem with real world case to author(s)
5. Temporarily alter the app if I know or trust that the changes will be
made in a forthcoming release.

--
Melvyn Sopacua

T Thomas

unread,
Nov 17, 2016, 11:36:04 AM11/17/16
to Django users

Hi ,

 

Hope this email finds you well! We are App Innovation Technologies expertise in Microsoft SharePoint, with the latest .NET Framework 3.5, 4.0 and 4.5 and sound knowledge in developing WPF based window and web applications. We use PHP, Word-Press and other open source technologies for website development and on mobile we work on iOS, Android and Windows applications.

 

 Our lab is equipped with dedicated TFS 2012, MS SQL server 2012, MS SharePoint 2010 Enterprise servers in the base of Windows Server 2012 and Windows Server 2012 R2. We offer good quality work on a reasonable cost.

 

If you have any project, Please let me know.

 

Our work:

1. ASP.Net / .Net

2. Website

3. iOS Application

  

Thanks & Regards,

Thomas Russell

+1-224-636-9884

App Innovation Technologies

Reply all
Reply to author
Forward
0 new messages