Formerly A. Judson Weiler, the petitioner, and Helen C. Weiler were husband and wife. They entered into a formal written contract settling their property rights. Later, Mrs. Weiler applied for divorce. Among other things she pleaded "that prior to the commencement of this action, by a written agreement, plaintiff and said defendant settled and adjusted between themselves their respective rights in and to all community property of said marriage, *Page 487 which said settlement plaintiff hereby requests the court to approve and confirm." In her complaint she did not pray for counsel fees, costs or maintenance. The husband allowed his default to be taken. In the interlocutory decree the trial court inserted the following: "It is further ordered, adjudged and decreed that this court does hereby approve and confirm and make a part of this decree the provisions of that certain property settlement agreement made and entered into between the parties hereto and executed by them on the 15th day of May, 1928." In the final decree that order was repeated. The defendant failed to make some of the payments provided in the written agreement and so adopted by the trial court. A motion was duly and properly made in the trial court asking that he be required to make the payments. After certain proceedings were had the order was made, but nevertheless the defendant neglected and refused to make the payments. He was adjudged guilty of contempt of court and later applied to this court for a writ of habeas corpus. In support of his application he makes the following points:
[1] It is claimed the contract purported to limit the power of the court to provide alimony, counsel fees and costs. To this claim there are several answers. There is nothing on the face of the instrument which necessarily supports that claim. No request was made, no ruling was made, and the point is before us exgratia. The identical covenant was not approved expressly and the record does not show any request was made that it be approved or disapproved.
The agreement recites that the parties are now (May 15, 1928) living separate and apart. It does not contain a word to the effect that either party does, or will do, anything to facilitate either party in obtaining a divorce. With much care it provides for a division of the property owned by the parties. [2] The law does not prohibit but it authorizes the making of such contracts. (Roberts v. Roberts, 83 Cal.App. 345, 351 [256 P. 826].) When the parties are settling their property rights, the law does not provide that they may settle some and that they may not settle others. [3] In the instant case, having divided their properties in kind, there was inserted a covenant that *Page 488 the husband was released from all claims "for alimony, support, and maintenance, attorney fees, and costs of suit." That covenant was not contra bonos mores. [4] It contained a further covenant that "the provisions of this agreement shall be referred to in any judgment of divorce between the parties hereto and made a part thereof." As stated above the plaintiff's complaint pleaded the execution of the agreement and asked its adoption by the divorce court. Said pleading furnished support for the judgment subsequently rendered. Whether the latter covenant was present or absent, the divorce court had full power to examine the contract and to examine into all of the facts surrounding its execution and to accept it or reject it in whole, or in part, according to the law and the facts. (Roberts v. Roberts,supra.) The force of the agreement depended on the sanction of the divorce court (Loveren v. Loveren, 106 Cal. 509, 513 [39 P. 801]). [5] The trial court having confirmed the agreement it became a part of the court's decree (Locke Paddon v. LockePaddon, 194 Cal. 73, 81 [227 P. 715]). The fact that a copy of the agreement was not attached to, nor pleaded in haec verba, in the complaint is of no moment. We are not considering a demurrer. By an appropriate passage contained in the interlocutory decree and repeated in the final decree the agreement was made a part of each decree. What was formerly merely an agreement of the parties became a part of the judgment of the trial court. (Tripp v. Superior Court, 61 Cal.App. 64 [214 P. 252].) The case entitled Andrews v. Superior Court,103 Cal.App. 360 [284 P. 494], was based on a different set of facts and is not controlling in the instant case.
[6] Because of the wording of the prayer to the complaint the petitioner asserts the trial court awarded the plaintiff more relief than demanded in her complaint. (Code Civ. Proc., sec. 580) To this charge there are many answers. If it did as claimed it was an error and not an excess of jurisdiction. (14 Cal. Jur. 908.) As the basic judgment was in a divorce case, we have just shown that in passing on the terms of the written agreement and making an order adopting or rejecting it the trial court did not exceed its jurisdiction and that it but performed a duty *Page 489 enjoined by law. In the body of her complaint the plaintiff pleaded the execution of the agreement and asked its adoption and ratification by the divorce court. [7] Now it will be conceded that it is the general rule that the trial court when determining what is "demanded in a complaint" will be guided by an inspection of the prayer. (14 Cal. Jur. 906.) But there is a well-established exception. When, as here, the general law prescribes the manner of framing a judgment and carrying it into execution, if the trial court follows that manner, whether expressly prayed for or not, the court does not violate the provisions of section 580 of the Code of Civil Procedure. (Bankof Ukiah v. Reed, 131 Cal. 597, 601 [63 P. 921]; Securityetc. Co. v. Boston etc. Co., 126 Cal. 418, 424 [58 P. 941,59 P. 296]; Elston v. Hix, 67 Mont. 294 [215 P. 657, 659].)
We find no error in the record. The petitioner is remanded and the writ is discharged.
Nourse, P.J., and Spence, J., concurred.