Hi Lucy,

Did you manage to get this to work? 
Please see this discussion with the same 
problem: 
https://groups.google.com/forum/#!msg/archesproject/Khj1ddBxAYk/G4TeZj1dBAAJ

As Adam summarizes: copy the arches_hip/models/resource.py file, paste it 
into the corresponding directory of your own app, and then change the 
RESOURCE_MODEL to something like:
RESOURCE_MODEL = {'default': '{}.models.resource.Resource'.
format(PACKAGE_NAME)}

As to your questions:
- .pyc files are created when Python runs your .py file for the first time. 
It compiles it into bytes and saves it as .pyc. After that, the Python 
compiler will only recreate the .pyc if anything in your .py has changed.
You are correct to think the absence of a .pyc version of your customized 
script means it is not being used. 

- Generally speaking, your files are owned by root if you installed/copied 
it while running under the root user. I install/run Arches under root as 
well, but I am not sure if there are better solutions (e.g. a less 
privileged user). Perhaps the community here can fill us in :)


Good luck, 
Vincent


On Sunday, 6 November 2016 05:29:49 UTC-5, Lucy FJ wrote:
>
> Hi everyone,
>
> This is a basic technical question which I am asking as a not particularly 
> technical person. 
>
> We are customising Arches and are changing forms.py because we have added 
> new nodes to the Heritage Resource graph. 
> I have copied forms.py from the Arches HIP directory, changed it and put 
> it into our custom directory. I opened Arches and found that the changes 
> had not taken effect and noticed that a .pyc file had not been created in 
> the custom directory. I assume that the .pyc file in the HIP directory is 
> being read instead? (It is still there). I have tried stopping and 
> restarting our server and still the .pyc file fails to be created. The file 
> resource.py has been changed as suggested by the Arches documentation to 
> pick up the correct version of 'forms' (*from arches_hip.models import 
> forms *has been changed to *import forms*) and is also located in the 
> custom directory. What is the mechanism that causes the .pyc file to be 
> created? I was wondering if it was a permission/ownership problem. All our 
> Arches programs are owned by Root. is this normal in an Arches 
> installation? 
>
> Thank you very much for your help.
>
>
>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to