[Zope-dev] Zope and python namespaces
I wrote an external method that uses Graphite, Sping and PIL to generate charts, but I ran into some namespace problems. Execution of the external method fails because there is a clash in the namespace between PIL and Zope. PIL has a module ImageFile and Zope does as well. Even if I insert PIL's path explicitly as the first entry in the path, Zope's ImageFile is still being used. How can I resolve this and what is the best strategy to avoid namespace problems here? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns Design Issue
I generally follow this approach for long lists and reports, but the tree tag is a bit more tricky because you only have a simple data object without the context that a real object provides. A real object makes it a lot simpler if you recursively draw a hierarchy - doing it with simple data objects requires some thinking but thanks for pointing me in the right direction. Roché Just return the result directly. If the data is all from SQL, that's all you need to do. The catch is that you may have to structure your ZClass differently to allow it to be returned from an SQL method. The simplest thing, though, is to define your application API's so that methods which must return multiple objects in this fashion are returning sequences of simple data objects which do not provide the full semantics of the real objects. In essence, define the API as returning reporting data rather than objects. This is similar to the ZCatalog approach which returns dumb record objects, but can optionally retrieve the real object if needed. It is generally the best approach for report-like situations (such as use of the tree tag). ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns Design Issue
Hi Everybody We are porting a desktop application to Zope using Interbase and ZPatterns. In this application objects like Vintage, Farm, Vineyard, Block and Panel form a hierarchy and are displayed with the Zope tree widget. To build the hierarchy we use a method called getChildrenFor() on each level to retrieve the children for the object at hand. Behind getChildrenFor() lies a ZSQL Method on their respective racks to retrieve the result set. Building the tree leads to a whole bunch of queries to the database that really slows thing down ie. besides the queries that retrieve children, select queries to retrieve individual instances is called by getItem through SkinScript for each item in the tree. I haven't been able to figure out a way to get some performance back without talking to the database directly through ZSQL Methods but this defies the whole point of using ZPatterns. Some guidance/pointers would really be appreciated. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns Design Issue
How do you bind a SQL Result with multiple records with multiple instances of the class? Can you do this in Skinscript? Or do you mean I should return the sql result directly? Roché Why don't you just have the rack's getChildrenFor() method return instances of the correct class, with all the data filled in from the SQL method? There should be no need to re-retrieve the same items with getItem(). Note, by the way, that this does not violate encapsulation, since the specialist and racks are specifically the place to put implementation-specific versions of multi-object methods like this. (Btw, if anybody's compiling a ZPatterns FAQ, this should probably get in there.) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns: getItem returns None
Seems like the first element of the list of result objects returned by sqlGetAllotmentArea doesn't define anything called 'AllotmentArea_ID'. Could it be a case problem? What datbase/db_adaptor are you using? It is a case problem, which really surprised me because Interbase is not case sensitive. I feel a bit stupid for not having considered this as a possible problem but for anybody using the Gvib Interbase DA, note that column names are capatilized in results. Dammit stupidity can waste a lot of time. Thanks for pointing out the obvious. Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns: getItem returns None
In my experience, getItem will return None if *anything* goes wrong with data retieval or object creation. Sometimes you get a traceback in the STUPID_LOG, and sometimes you don't (and I haven't figured out the pattern yet). Test everything you can independently, and simplify everything to the bare minimum until you get it to work, and then add back the other variables, etc. In all simplicity I still can't get it to work but here's some more info from the console: Traceback (innermost last): File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.py, line 335, in _AttributeFor (Object: GAPMixin) File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.py, line 13 6, in eval KeyError: AllotmentArea_ID Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns: getItem returns None
On Mon, 19 Mar 2001, Roch'e Compaan wrote: In all simplicity I still can't get it to work but here's some more info from the console: Traceback (innermost last): File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\AttributeProviders.py, line 335, in _AttributeFor (Object: GAPMixin) File C:\PROGRA~1\ZOPE230\lib\python\Products\ZPatterns\Expressions.py, line 13 6, in eval KeyError: AllotmentArea_ID If I knew more about the internals of ZPatterns I bet this would tell me exactly what's wrong, but I don't, so it doesn't. Have you looked at the information screen that tells you which attributes are handled by which providers to make sure it is your skinscript that is providing the attribute? To my limited knowledge it looks like maybe the wrong attribute A single line of SkinScript acts as the "Getter" for AllotmentArea_ID: WITH QUERY sqlGetAllotmentArea(AllotmentArea_ID=self.id) COMPUTE AllotmentArea_ID, AreaName, AreaCode There are no persistent attribute or sheet providers - I deleted all of them and the proxy role for the SkinScript is set to manager. I fired up the python debugger as well and it seems if and "instance" is retrieved but the attribute is not computed as specified by the SkinScript. provider is getting into the act. Hopefully someone with more knowledge than me will chime in wry grin. We'll thanks for your pointers anyway. Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: getItem returns None
I think I've read everything on the mailing lists on this issue, but have found no joy. I have a ZClass derived dataskin called AllotmentArea matching a table with the same name in my SQL RDBMS. I have a Specialist called AllotmentAreas with storage set to the AllotmentArea ZClass and load attribute set to "AllotmentArea_ID" and this property does not exist on the ZClass propertysheet. When I call getItem(existing_id) on the specialist, it returns None. SkinScript for retrieval: WITH QUERY sqlGetAllotmentArea(AllotmentArea_ID = self.id) COMPUTE AllotmentArea_ID, AreaName, AreaCode Note: The Proxy Role for the SkinScript is set to Manager. sqlGetAllotmentArea: Select * from AllotmentArea where AllotmentArea_ID = dtml-sqlvar AllotmentArea_ID type=string Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Specialists and __bobo_traverse__
Phillip J. Eby wrote: I'm pretty sure DTML methods *won't* work. "Python Methods" might. I don't know about external methods, python scripts, etc. I have successfully used PythonScripts for this. Does this mean I have to upgrade to 2.3 beta 1, because Python Methods on 2.2.4 doesn't work? Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Specialists and __bobo_traverse__
I'm still lost as to when __bobo_traverse__ is checked for object traversal and when not. I have very simple piece of SkinScript: WITH SELF COMPUTE __bobo_traverse__ = traversal_method. Looking at the traverse method in BaseRequest.py it looks to me as if an object is always checked if it has a __bobo_traverse__ method but this is not what is happening. If I manually type in a url, say path.to.specialist/dataskin1, where dataskin1 exists, my traversal_method is not called. When I type in path.to.specialist/dataskin2, where dataskin2 does not exist then my traversal_method is called. Noticing that the traversal_method is called when an object can not be found I tried path.to.specialist/dataskin1/dataskin2, where dataskin1 is in the specialist's rack but dataskin2 is in another specialist's rack and will therefor not be found. In this case my traversal_method was not called. If it was then I could retrieve it from the appropriate specialist. I hope the above is clear because I'm somewhat desperate at the moment. If I'm trying the impossible, a simple "forget about it" will also do. Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Specialists and __bobo_traverse__
It sounds to me like you're trying to have SkinScript supply a bobo_traverse for the Specialist itself, and this you cannot do. (There are other ways to change a Specialist's bobo_traverse behavior, but SkinScript is not one of them.) The SkinScript you're doing is meaningful only if you want to go to specialist/skin1/something, in which case your traversal_method should be called to process "something". This is exactly what I want to do ie. process "something". I don't have the slightest idea what you're trying to accomplish here - I probably missed the beginning of this thread. Do you want to change the way the specialist processes the string "dataskin1", or the way dataskin1 processes the URL component that comes next? Each requires a different approach. The best way to describe this is with an example I suppose. I have a specialist "Products" and nested within "Products" is another specialist "Modules". The current status quo: I go to a Product dataskin with a url like Products/product_id. I go to a Module dataskin with a url like Products/Modules/module_id Where I want to be: The url to the Product dataskin stays the same. I go to a Module dataskin with url like Products/product_id/module_id As I see it the module_id is like the "something" you mentioned above. The module dataskin would obviously not be found by the Products specialist, and in that case I simply want to tell it to go look in the Modules specialist for the module. I hope this makes more sense, if not I'll be glad to explain more. Many thanks Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Specialists and __bobo_traverse__
Recent sightings of the use of __bobo_traverse__ in SkinScript gave me hope of giving users a more useable breadcrumbs trail in the case where I have nested specialists. My TaskTemplates specialist is nested inside my RequestTypes specialist. When I retrieve a dataskin from the RequestTypes specialist I have a tab that lists TaskTemplates for that RequestType specialist. Following a link from the TaskTemplate list takes you to that instance. Thus results in a url like this: /RequestTypes/request type instance/Task Templates/task template instance, and what I ideally want is: /RequestTypes/request type instance/task template instance. I read all the comments about __bobo_traverse__ and created a python method, "traversal_method" inside the "RequestTypes" specialists. I must admit that I don't really understand Zope's traversal machinery yet and would appreciate some guidance. My SkinScript for RequestTypes: WITH SELF COMPUTE __bobo_traverse_=traversal_method My traversal_method: ob = getattr(self, name) if ob is not None: return ob else: ob = self.TaskTemplates.getItem(name) if ob is not None: return ob raise 'NotFound' Any help would be greatly appreciated. Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Specialists and __bobo_traverse__
With your code below, and with a concrete example, can you say what you want to happen, and what actually does happen? Thus results in a url like this: /RequestTypes/request type instance/Task Templates/task template instance, and what I ideally want is: /RequestTypes/request type instance/task template instance. Let's say I have a RequestType called "Evaluation of Product". For this request type I create Task Templates called "Record Customer Details" and "Ship Product to Customer". If I go to the Request Type "Evaluation of Product" the url is: path.to.requestypes/evaluation_of_product. This gives me the detail of the request type as well as the list of task templates relating to this request type. If I now follow the link to the task template "Record Customer Details", I simply want to click on a url that says path.to.requesttypes/evaluation_of_product/record_customer_details and do not explicitly want to go the TaskTemplates with path.to.requesttypes/evaluation_of_product/TaskTemplates/record_customer_det ails. In other words, my traversal_method for the RequestTypes specialist should first seek the object on it's own rack and if it can not find it is should ask the nested TaskTemplates specialist for the object. Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Specialists and __bobo_traverse__
With your code below, and with a concrete example, can you say what you want to happen, and what actually does happen? In my traversal_method I have one line that simply changes a property on the specialist to see if the method is actually called but it does not seem like the traversal_method is called at all. The skinscript I use (as said in my previous mail) is: WITH SELF COMPUTE __bobo_traverse__=traversal_method Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns and ZClass Views
I was wondering to what extent people using ZPatterns find the Views one can set up for a ZClass tolerant of the Role-centric approach followed by ZPatterns. For example: I have two Specialists, DocumentedProducts and Products. The Products specialist manages ZClasses of type 'Product'. Products are remapped to DocumentedProducts (where product plays the role of documented product). Typically in Zope, ZClass Views has bearing on a single Zope Object and Views are filtered according to User Roles, thus the focus is security. ZPatterns makes it possible to extend the roles an object has. Ideally the Views in a ZPatterns Application framework would be security AND role (the role the object plays) focused ie. when I look at a Product instance where it plays the role of documented product, I might have the views FAQs, HOWTOs, etc. But when I look at a Product inside the Products specialist I want the views Properties, Associated Files, etc. I like the idea of making the Views of a ZClass my starting point because at least it already filters according to the role a user might have. Any other ideas/comments? Roch ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] External method
This is not a strictly zope related question but it is zopeish :) In an external method I need to call an executable and capture the output it generates. This executable however needs to connect to a running X Server. I used the popen2 command but it returns with the obvious error : "theprogram : cannot connect to X Server". So how does one tell a program to attach to a X server? Any help would truly delight me Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: General Design Question
As part of a Customer Relationship Management system our company is developing, we have a Licenses specialist which manages product licenses. All license objects do not have the same attributes however. The various attributes relating to different licence types are not known attributes from the outset. My idea is to have a LicenseType class for which the user can define extra attributes per instance eg: LicenseType1 with properties A,B,C LicenseType2 with properties D,E,F When new licenses are created the user first selects a LicenseType. Based on this selection the properties of the selected LicenseType are added to a specific License instance. As I see it one can take two approaches to this: a) either add a single dictionary property for both license and licensetypes which holds user defined attributes or b) explicityly call manage_addProperty per instance to add properties. Any ideas? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: Still Properties that are objects
I use external methods to set properties that are objects for my Dataskins. I have a Customer Dataskin with a property Address. Address is another Dataskin. In my editInstance for Customer I change the properties of Address directly: dtml-call "propertysheets.basic.manage_changeProperties(REQUEST=REQUEST)" dtml-call "Address.propertysheets.basic.manage_changeProperties(REQUEST=REQUEST)" but this results into a keyError afters a couple of edits ie. it works SOMETIMES but not all the time. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Mail and zope
Is there anyway to get a hold off the message-id of e-mail sent through the sendmail tag? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Mail and zope
Is there anyway to get a hold off the message-id of e-mail sent through the sendmail tag? As far as I can see, there isn't any generation of a message-id in the MailHost product. [snip] Thanks for the suggestion, this is what I'm trying to do: We're building a customer relationship management system and one part of it is a request tracking system. For a particular request there can be many tasks assigned to various supporters. A supporter can give feedback to customer from a task assigned to him. If the customer replies to this task via e-mail I want to associate that message with the task where the feedback originated from but most e-mail clients discard custom headers but preserve a 'In-Reply-To' header with the original message-id. This is what I do currently: If the supporter sends feedback to the customer I send a copy of the mail back into zope to get the message-id generated by the MTA and then store the message with the approriate task. When the customer replies to this message I search a catalog for the original message-id via the 'In-Reply-To' header and then associate the reply with the correct task. In this way one can keep track of all correspondence on a specific task. If I can generate the message-id like you suggested then I don't have to send a copy of the message back into zope but can save a copy directly in Zope. Any other suggestions would be more than welcome. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Method calls
I have a method called getModulesForProduct to which I pass a ProductID eg: dtml-in "Products.Modules.getModulesForProduct(this(), _, ProductID)" sort=name If ProductID is passed on from a form variable it works fine. If I set the ProductID through REQUEST.set: dtml-call "REQUEST.set('ProductID',_.str(Product.id))" , I get a TypeError: Error Type: TypeError Error Value: hasattr, argument 2: expected string, int found I've been banging my head against this problem the whole day so help would really be appreciated. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Method calls
OK.. it's the 'in' tag that's causing the problem. Why not try: dtml-var "experession that's causing problem with in" html_quote and see what 'in' is choking on... It's choking on a list of instances. This is what is returned when I "var" the expression: [Module instance at 8b97660, Module instance at 88f04b0, Module instance at 8994730, Module instance at 8b46a08] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: Dataskin property sheets
I'm not as clear as I'd like to be on when to use Dataskin property sheets and when to use common instance property sheets. I understand that with a Dataskin Property Sheet attributes are stored in way that is compatible with attribute providers making overriding of default values possible. If this is the case shouldn't one always use a Dataskin Property Sheet to retain this flexability. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatters: Roles and remapping
An Organisation can play the role of Customer and of Requester. In this case the Requester specialist will remap from the Customer specialist. In terms of roles all Customers do not play the role of Requester. Would it be correct to say that the remapping to Requester only occurs at that point in time, when the Customer plays the role of Requester and therefor becomes a Requester, as opposed to mapping the Customer to a Requester as soon as the Customer is created? In the latter case the Customer's rack pushes attributes to the Requester's rack and in the former the requester will first ask the Customer specialist for all Customers and then create a Requester for the Customer selected from the list. The reason I ask this is: Remapping in some way implies that the existence of the one implies the existence of the other. This is one place where frameworks colloborate and I think that colloboration should be carefully exercised so any input would be greatly appreciated. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] RE: RFC : ZPatterns Customer Relationship Management Framework
Thanks for your comments on our model Philip, it is really appreciated and very enlightening. From your comments some other questions came to mind (I posted this on the Wiki as well): It seems that we did not give enough consideration for the pattern, Roles Before Objects but we can retrofit this pattern to our existing design without to much trouble. The area where I need more guidance is on the ability of a specialist to add attributes on top of objects. Thinking out load: Objects might have different attributes depending on the roles they play in various application frameworks. Specialists make it possible to add these attributes through AttributeProviders. One might create a Person ZClass with properties Name, Surname, Age. When the Person plays the role of Customer we will create a Customers specialist for that role providing us with services relevant to dealing with Customers. Let's say for now that the properties defined on our ZClass propertysheet for Person suffices for the Customer role. Our Person object also plays the role of Requester in our Requesters specialist. For this role we need an extra attribute, Priority. The Requesters specialist will ask the Customers specialist for properties Name, Surname and Age but will store the attribute Priority in it's own rack. For storage in the ZODB this will imply that the extra attributes will be stored persisently in the slots of the Requester. For non-ZODB storage like a SQL RDB one will have to add a table to the RDB. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] RFC : ZPatterns Customer Relationship Management Framework
Thanks a lot for all the guidance on ZPatterns so far. Our company is building a Customer Relationship Management system using ZOPE and ZPatterns. We have a object model and basic Dataskins and Specialists in place. At this point we thought it a good idea to share the object model with the Zope community and invite comments since we will be giving it back to the Zope community. Go to http://www.zope.org/Members/sparroy/CRM to download a pdf of the model and make some comments. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Objects that are properties
I have a Customer and Address ZClasses based on Dataskin as well as a CustomerManager specialist. The Customer ZClass has a external method setAddress: def setAddress(self, Address) self.Address = Address CustomerManager has a defaultRack and addressRack. The methods that adds the instance contains this: dtml-let newCustomer="newItem(name)" dtml-call "newCustomer.propertysheets.Basic.manage_changeProperties(test=test)" dtml-let address="addressRack.newItem(id)" dtml-call "address.propertysheets.basic.manage_changeProperties(test=test)" dtml-call "newCustomer.setAddress(address)" /dtml-let /dtml-let and it seems to work fine. Then to retrieve the Customer addresses I call: addressRack.getPersistentItemIDs()" but there seems to be a problem with permissions because Zope prompts me for username and password although i'm already working in the management interface. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns: Non-ZODB storage and Racks
In Rack.py I noticed the following: a = self.loadAttrib if not a: slot = self._writeableSlot(key) slot[SelfKey] = item.aq_base# strip acquisition wrapping item._setSlot(slot) # Not needed for non-ZODB storage If item._setSlot set is not needed for non-ZODB storage should I subclass rack and override createItem? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Objects that are properties
This is a known problem. Use: dtml-let itemIDs="[]" dtml-in "addressRack.getPersistentItemIDs()" sort dmtl-call "itemIDs.append(_['sequence-item'])" /dtml-in Now you have the required itemIDs in itemIDs. /dtml-in Thanks Steve and thank you Phillip for ZPatterns. I've managed to create a very basic framework storing attributes in the ZODB and in a SQL RDBMS. I'm elated. This is the way to write applications, IMHO. A couple of things are still unclear but I at least feel that I can create now. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns: Non-ZODB storage and Racks
I'm not sure I understand your question. If you don't have something special you want to do by subclassing Rack, then the answer would be "no". :) You do answer my question below. I was wondering if this line would not cause an object to be stored in the ZODB by default. The comment is perhaps misleading. What it means is that the _setSlot call isn't needed if your Rack implements a non-ZODB storage mechanism. The reason *why* it isn't needed, is that the DataSkin will ask for a slot on demand, so that a ZODB record is only created if something needs to be stored persistently. However, in the case where you have not set a "load" attribute (i.e., you are storing actual objects in the ZODB), then one might as well tell the object its slot, because the slot is where the object itself is going to be stored. Technically, the _setSlot call isn't necessary even then, because the DataSkin could still ask for it on demand. However, since the code at this point has gone to the trouble of getting the slot object, it might as well pass it to the DataSkin immediately. Here I loose you. What does "setting the load attribute" mean? I did manage to store objects in a SQL RDBMS through some skinscript methods that call sql methods. I assumed selecting a ZClass on the storage tab simply informs the ZClass what it's rack is. I couldn't verify if these objects were stored in the ZODB as well as in my RDBMS. Besides writing some skinscript and sql methods is there anything else one should do to only use non-ZODB storage. When will I use attribute and sheetproviders and do they come into play at all with non-ZODB storage. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ZPatterns: Non-ZODB storage and Racks
It's determined by the radio button setting on the Storage tab. If you neglected to set it to "loaded by accessing attribute " and fill in the blank, then your objects have been stored in the ZODB, as well as in the RDBMS. Thanks. I set "loaded by accessing attribute" to the attribute "id". Storing items in the RDBMS works fine. But when I try to retrieve them with getPersistentItemIDs() nothing is returned? I have a skinsript method getCustomer: WITH getCustomerSQL(CUSTOMER_ID=self.id) COMPUTE id=CUSTOMER_ID, name=NAME and getCustomerSQL is a SQL method. Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] It's been a while
It's been a while since i've had time to explore ZPatterns - and now the time has come that I am considering to base development for a new project on ZPatterns. I think I'm better prepared now - I read Coad's Object Models, and implemented a data management layer in Delphi. The project envolves Customer Relationship Management - like openticket, but I don't like openticket's tight coupling with the SQL databases. First stupid question: Are ZClasses based on Dataskins PD (Problem Domain) objects or DM (Data Management) objects? Can somebody possible categorize the main classes in ZPatterns according to Problem Domain, User Interface, Data Management? Would it be safe to base development on ZPatterns if I want to use an SQL RDBMS as storage and ZPatterns as DataManagement layer ie. is ZPatterns stable engough? Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZODB
I am getting really funny problems with my Zope installation and I have no idea where to start looking. I for instance deleted a python product from the Products directory and when I start Zope the product is still listed in the Product list. I then packed the ZODB, cleared my Browser's cache, and refreshed the Product List but still the product is visible. I can however delete the python product (which is by the way not in my Products directory) from the Control Panel. Somewhere something is cached and I don't know where. It seems to cache errors as well and they stick. A reinstallation fixed this problem, but now it seems more fundamental. I've come accross this odd caching behaviour again after reinstall and can't reinstall every time this happens. I run Zope 2.2.2 behind Apache 1.3.9 and do virtualhosting with the ProxyPass directive. Please help!! Roché ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope] Mailhost TypeError
I'm recreated a mailhost in Zope 2.2.0. Whenever I want to send mail with sendmail tag I get a TypeError. This worked in Zope 2.1.x. This is the traceback: Traceback (innermost last): File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2-2-0/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: RoleManager) File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2-2-0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_editProperties) File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_editProperties) File /usr/local/zope/2-2-0/lib/python/Products/Etailer/OrderManager.py, line 136, in manage_editProperties (Object: RoleManager) File /usr/local/zope/2-2-0/lib/python/App/special_dtml.py, line 120, in __call__ (Object: testemail) File /usr/local/zope/2-2-0/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: testemail) File /usr/local/zope/2-2-0/lib/python/Products/MailHost/SendMailTag.py, line 188, in render (Object: MailHost) File /usr/local/zope/2-2-0/lib/python/Products/MailHost/MailHost.py, line 220, in send (Object: MailHost) File /var/tmp/python/python-root/usr/lib/python1.5/smtplib.py, line 465, in sendmail File /var/tmp/python/python-root/usr/lib/python1.5/smtplib.py, line 349, in mail File /var/tmp/python/python-root/usr/lib/python1.5/smtplib.py, line 118, in quoteaddr File /var/tmp/python/python-root/usr/lib/python1.5/rfc822.py, line 451, in parseaddr File /var/tmp/python/python-root/usr/lib/python1.5/rfc822.py, line 496, in getaddrlist File /var/tmp/python/python-root/usr/lib/python1.5/rfc822.py, line 504, in getaddress File /var/tmp/python/python-root/usr/lib/python1.5/rfc822.py, line 484, in gotonext TypeError: len() of unsized object -- The source for my DTML method: dtml-if orderemail dtml-sendmail mailhost="MailHost" To: dtml-var orderemail From: dtml-var orderemail Subject: Test email from dtml-var shopName Hi, This is a test email from your online shop. If you have received this email, then you will also receive an email for each of the orders that are placed at your online store. /dtml-sendmail /dtml-if ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Selection Property
You need to set up the "bandlist" method as the Value when adding the selection property, then make shure that the "bandlist" method is available from where you use the property sheet. Been there, done that, still no luck :) But in the dtml source for properties it says getProperty(select_variable). If I populate a lines type property in the current folder and then do dtml-return myProperty it works. Roché ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] Squishdot
I've upgraded our Zope Server to 2.2.1 and upgraded squishdot to 7.1. Whenever I post an article on my squishdot sites I get an attribute error: _catalog. It seems like squishdot has trouble putting the article in the catalog. I did modify all references to thread[0] to getThread(0): Traceback (innermost last): File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2-2-0/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2-2-0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: addPosting) File /usr/local/zope/2-2-0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: addPosting) File /usr/local/zope/2-2-0/lib/python/Products/Squishdot/Squishdot.py, line 979, in addPosting (Object: Traversable) File /usr/local/zope/2-2-0/lib/python/Products/Squishdot/Squishdot.py, line 702, in setItem (Object: Traversable) File /usr/local/zope/2-2-0/lib/python/Products/ZCatalog/ZCatalog.py, line 377, in catalog_object (Object: Traversable) AttributeError: (see above) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )