
113 Cal.Rptr.2d 363 (2001)
93 Cal.App.4th 773
Addie P. JACKSON et al., Plaintiffs and Respondents,
v.
HOMEOWNERS ASSOCIATION MONTE VISTA ESTATES-EAST, Defendant and Appellant.
No. E028566.
Court of Appeal, Fourth District, Division Two.
November 5, 2001.
*364 Wilion, Kirkwood & Kessler, Gary Kessler and Allan E. Wilion, Beverly Hills, for Defendant and Appellant.
Paula Forthun-Baldwin, for Plaintiffs and Respondents.

OPINION
HOLLENHORST, Acting P.J.
Defendant homeowners association appeals from a trial court order granting plaintiffs' request for attorney fees pursuant to Civil Code section 1717.[1]
The case presents for decision the interesting question of whether section 1717, subdivision (b)(2) precludes any award of attorney fees to the prevailing party when the parties sign a settlement agreement which provides that the action will be dismissed after certain actions have been taken.
We hold that a settlement agreement which provides that the trial court will determine the prevailing party in the action, and the amount of the attorney fee award, if any, is valid and enforceable.

FACTS AND PROCEDURAL HISTORY
Plaintiffs Addie P. Jackson, Wade Sargent, and Genevieve Sargent (plaintiffs), brought this action to challenge certain *365 provisions of the conditions, covenants, and restrictions (CC & R's) adopted by defendant homeowners association.[2] Primarily, the action sought to invalidate a provision which purported to restrict home ownership in the subdivision to persons age 55 and older who live on the property.[3]
The trial court found the CC & R's enforceable, including the contested provision. Accordingly, it ordered that plaintiffs "take nothing from the Defendant Association and [plaintiffs] are not entitled to any relief or damages."
Plaintiffs appealed. In an opinion filed on September 29, 1998 (Kross v. Homeowners Association Monte Vista Estates-East (E020124) [nonpub. opn.]), this court considered a number of issues raised by the parties and found the challenged provision invalid insofar as it required owners to live on the premises. Our disposition states: "The judgment is modified as to plaintiffs Jackson and Sargent by modifying the second sentence of paragraph 16 of the 1988 CC & R's to read `This Subdivision shall be a Senior Citizen Development and at least one of the residents of each home shall be at least 55 years old.' As so modified the judgment upholding said restriction is affirmed as to plaintiffs Jackson and Sergent."
After our decision became final, plaintiffs filed a motion in the trial court requesting that court to determine the issues remaining for trial. Plaintiffs contended that the issues of damages, injunctive relief, and attorney fees remained to be tried. Although the transcript of the hearing on the motion is not in our record, plaintiffs assert that the trial court, Commissioner Trask (now Judge Trask), indicated her opinion that there were no further issues remaining to be tried as to plaintiffs.
Plaintiffs then filed a motion to disqualify Commissioner Trask, and the matter was transferred to Judge Kaiser. On February 17, 2000, Judge Kaiser held a hearing on the motion and indicated that the only issue left to be tried was the issue of damages as to plaintiffs Kross and Turner in the consolidated case. Plaintiffs in this case continued to claim that they had a right to damages for the lost rentals they incurred because of the invalid phrase in the CC & R's that allegedly prevented them from renting their property.
As this discussion continued at the February 17, 2000 hearing, the parties agreed to settle the case. The terms of the settlement were placed on the record and subsequently confirmed in a written settlement agreement.
Under the settlement agreement, defendant homeowners association agreed to pay the plaintiffs the sum of $2,500 without an admission of liability. It also agreed to adopt a prescribed resolution, to notify the Hemet Real Estate Board of certain matters, and to publish an agreed-upon notice in the Hemet newspaper. Upon completion of these actions, and payment of the settlement amount, plaintiffs would dismiss the action.
The parties were not able to agree on the issue of attorney fees. Accordingly, the settlement agreement provides: "The *366 Parties have agreed to reserve the issue of any award of costs and attorneys fees to Plaintiffs, as requested by Plaintiffs in their respective Complaints, for consideration by this Court upon Plaintiffs filing the necessary Motion and/or Memorandum of Costs with the Court." Although not clearly reflected in the settlement agreement, the parties also agreed on the record that the action would not be dismissed until the trial court had resolved the attorney fee issue.
Plaintiffs then filed a motion for the award of attorney fees and costs. Predictably, the homeowners association opposed the request, and argued that it had prevailed on appeal because the trial court's judgment had been affirmed as modified. Plaintiffs, in their reply, contended that they had prevailed on appeal because of the modification and the payment of the settlement amount to them.
The trial court agreed that plaintiffs were the prevailing parties, and ordered payment of attorney fees under section 1717 because of an attorney fee provision in the CC & R's. The parties renew their respective contentions here.

SECTION 1717
"Except as otherwise expressly provided by statute, a prevailing party is entitled as a matter of right to recover costs in any action or proceeding." (Code Civ. Proc., § 1032, subd. (b).) However, these costs do not include the attorney fees that the prevailing party has incurred in the litigation unless (1) an agreement between the parties provides for the recovery of those fees, or (2) a statute creates a right of recovery. (Code Civ. Proc., § 1021.)
Section 1717, subdivision (a) provides such a statutory right of recovery: "In any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney's fees in addition to other costs."
"By its terms, therefore, ... section 1717 has a limited application. It covers only contract actions, where the theory of the case is breach of contract, and where the contract sued upon itself specifically provides for an award of attorney fees incurred to enforce that contract. Its only effect is to make an otherwise unilateral right to attorney fees reciprocally binding upon all parties to actions to enforce the contract. [Citation.] [S]ection 1717 necessarily assumes the right to enter into agreements for the award of attorney fees in litigation, a right which it in fact derives from Code of Civil Procedure section 1021. Because of its more limited scope, ... section 1717 cannot be said to supersede or limit the broad right of parties pursuant to Code of Civil Procedure section 1021 to make attorney fees agreements." (Xuereb v. Marcus & Millichap, Inc. (1992) 3 Cal. App.4th 1338, 1342, 5 Cal.Rptr.2d 154, italics omitted.)[4]
Here, the reciprocal remedy of section 1717 was triggered by the presence of an attorney fee provision in the CC & R's: "In the event of any violation or threatened violation of any of the covenants herein, any owner of any Lot block, or Parcel in the Subdivision may bring action *367 at Law or in Equity, either for injunction, action for damages, or such other remedy as may be available. In the event the Homeowners Association recovers judgment herein, it shall also be entitled to recover from such person reasonable Attorney's fees."
The homeowners association contends that the plaintiffs cannot be prevailing parties because there has been no final disposition of the case. It relies on section 1717, subdivision (b)(2): "Where an action has been voluntarily dismissed or dismissed pursuant to a settlement of the case, there shall be no prevailing party for purposes of this section." Stripped to bare bones, the homeowners association argues that the subdivision means what it says: there is no prevailing party if the action is settled. Plaintiffs contend otherwise. In effect, plaintiffs argue that the subdivision should be read to mean that there is no prevailing party if the action is settled unless the parties agree otherwise. Plaintiffs thus contend that the provision of the settlement agreement which provides that the trial court shall determine whether there is a prevailing party, and the award of attorney fees accordingly, is a valid and enforceable provision. Of course, they go on to argue that the trial court properly determined that they were the prevailing parties, and that the award of attorney fees to them should therefore be affirmed.
The homeowners association relies on Bank of Idaho v. Pine Avenue Associates (1982) 137 Cal.App.3d 5, 186 Cal.Rptr. 695 and Presley of Southern California v. Whelan (1983) 146 Cal.App.3d 959, 196 Cal.Rptr. 1.
In the Bank of Idaho case, the party who prevailed on an appeal from the granting of a demurrer without leave to amend sought an interim award of attorney fees based on the appellate court's award of costs on appeal to it. The attorney fees claim was based on section 1717. The trial court refused to award attorney fees as costs and the appellate court affirmed. The appellate court found that the party claiming fees was not the prevailing party under section 1717 because it was not a party in whose favor a final judgment had been rendered. (Bank of Idaho v. Pine Avenue Associates, supra, 137 Cal.App.3d 5, 11-13, 186 Cal.Rptr. 695.) Citing section 1717, subdivision (b)(2), the court held that the subdivision makes it clear that there can be no prevailing party until the final disposition of the entire litigation. When an order sustaining a demurrer is reversed, the prevailing party obviously cannot be determined because the case had not yet been tried.
The court said: "[Subdivision (b)(2) of section 1717 makes it clear that there can be no prevailing party until the final disposition of the entire litigation. It creates two exceptions where there shall be no prevailing party even though the suit is finally disposed of in a manner entitling some party to costs of suit." (Bank of Idaho v. Pine Avenue Associates, supra, 137 Cal.App.3d 5, 16, 186 Cal.Rptr. 695.) The first is voluntarily dismissal and the second is settlement. The court accordingly found that "there can be no prevailing party until it is clear that the case cannot be voluntarily dismissed." (Ibid.) Citing this language, the homeowners association argues that this exception is applicable because the action here will be dismissed pursuant to the settlement agreement.
The court also found that the logic of the claiming party's contention had been rejected by the Supreme Court in International Industries, Inc. v. Olen (1978) 21 Cal.3d 218, 145 Cal.Rptr. 691, 577 P.2d 1031, a case discussed below.
*368 The homeowners association argues that there is more than a possibility of a voluntary dismissal because there is a settlement agreement requiring voluntary dismissal upon the fulfillment of certain conditions. Accordingly, since the litigation will be voluntarily dismissed, it argues the subdivision applies to bar recovery under section 1717. We disagree, because the argument neglects the fact that the settlement agreement also provides that, prior to dismissal, the trial court shall resolve the attorney fee controversy.
In Presley, the party claiming attorney fees had won an appeal reversing the trial court's granting of a summary judgment motion. Since the appellate decision did not finally decide the lawsuit, but merely reversed for further proceedings, the appellate court held that there was no prevailing party because the ultimate winner of the case had not been determined. In other words, "[t]here must be a prevailing party before the fee provision applies, and no one has yet prevailed here." (Presley of Southern California v. Whelan, supra, 146 Cal.App.3d 959, 961, 196 Cal.Rptr. 1.) Citing Olen, the appellate court reconfirmed that "there is no prevailing party where a suit is voluntarily dismissed following a settlement...." (Ibid.)
In Olen, the plaintiff voluntarily dismissed the action without prejudice and the defendant then sought to recover attorney fees. Our Supreme Court said: "[W]e are satisfied that sound public policy and recognized equitable considerations require that we adhere to the prior practice of refusing to permit recovery of attorney fees based on contract when the plaintiff voluntarily dismisses prior to trial." (Olen, supra, 21 Cal.3d 218, 223, 145 Cal. Rptr. 691, 577 P.2d 1031.) However, the court emphasized that "equitable considerations must prevail over both the bargaining power of the parties and the technical rules of contractual construction." (Id. at p. 224, 145 Cal.Rptr. 691, 577 P.2d 1031.) It therefore rejected "any rule that permits a defendant to automatically recover fees when the plaintiff has voluntarily dismissed before trial." (Ibid.) Nevertheless, the court concluded that "the parties in pretrial dismissal cases [should] be left to bear their own attorney fees...." (Id. at p. 225, 145 Cal.Rptr. 691, 577 P.2d 1031.)
Although the homeowners association seeks to invoke these rules here, we find them inapplicable because the action has been finally settled, subject only to determination of the attorney fee issue. It is therefore unlike cases in which there was a voluntary dismissal before trial or an intermediate appellate decision that reversed the trial court's sustaining of a demurrer or granting of a motion for summary judgment. More importantly, we find that the parties could validly waive section 1717, subdivision (b)(2) in order to submit the question to the trial court for resolution.
This conclusion is supported by a case relied on by plaintiffs, Reveles v. Toyota by the Bay (1997) 57 Cal.App.4th 1139, 67 Cal.Rptr.2d 543.[5] Plaintiffs also cite Coltrain v. Shewalter (1998) 66 Cal.App.4th 94, 77 Cal.Rptr.2d 600 and Santisas v. Goodin, supra, 17 Cal.4th 599, 71 Cal. Rptr.2d 830, 951 P.2d 399.
In Reveles, defendant Toyota offered to settle on the eve of trial. Plaintiff Reveles agreed to do so, provided that the trial court retain jurisdiction to determine whether he was the prevailing party and whether he was entitled to attorney fees and costs. Toyota subsequently reneged and contended that the trial court lacked *369 jurisdiction to make a prevailing party determination because the judgment had been entered by agreement, rather than after trial. The appellate court found that Toyota had waived the argument and that the procedure used was proper.
On the procedural issue, Toyota argued that the trial court could not, and should not, have determined "`who would or should have "prevailed" simply for the sake of granting fees without having a full trial on the merits of the case.'" (Reveles v. Toyota by the Bay, supra, 57 Cal. App.4th 1139, 1149, 67 Cal.Rptr.2d 543.) The appellate court found that Toyota had waived the issue, and that it was bound by its stipulation. We agree with this holding and therefore likewise conclude that the homeowners association is bound by the terms of the settlement agreement that it signed. The procedure used here was proper.
The homeowners association contends that this portion of Reveles has been overruled by our Supreme Court's subsequent decision in Santisas v. Goodin, supra, 17 Cal.4th 599, 71 Cal.Rptr.2d 830, 951 P.2d 399. In Santisas, our Supreme Court characterized the issues and its holding as follows: "The issues here are these: When a plaintiff has voluntarily dismissed before trial an action asserting both tort and contract claims, all of which arise from a real estate sales contract containing a broadly worded attorney fee provision, may the defendant recover any of the attorney fees incurred in defending the action? Or is any or all of such recovery precluded by either ... section 1717 or this court's decision in [Olen]? [¶] We conclude that in voluntary pretrial dismissal cases, ... section 1717 bars recovery of attorney fees incurred in defending contract claims, but that neither ... section 1717 nor [Olen] bars recovery of attorney fees incurred in defending tort or other noncontract claims. Whether attorney fees incurred in defending tort or other noncontract claims are recoverable after a pretrial dismissal depends upon the terms of the contractual attorney fee provision." (Santisas v. Goodin, supra, 17 Cal.4th 599, 602, 71 Cal.Rptr.2d 830, 951 P.2d 399.)
The court first considered whether the defendants were prevailing parties who were entitled to recover the attorney fees which they had incurred in the defense of the contract and tort causes of action. (Santisas v. Goodin, supra, 17 Cal.4th 599, 608, 71 Cal.Rptr.2d 830, 951 P.2d 399.) It applied the cost statutes and the contractual terms and considered the litigation objectives of the parties in reaching the conclusion that the defendants had prevailed. It then considered whether such recovery was precluded by section 1717 or Olen. (Santisas, at pp. 609-622, 71 Cal. Rptr.2d 830, 951 P.2d 399.) The court concluded: "If an action asserts both contract and tort or other noncontract claims, section 1717 applies only to attorney fees incurred to litigate the contract claims." (Santisas, at p. 615, 71 Cal.Rptr.2d 830, 951 P.2d 399.)
At oral argument, the association's counsel emphasized the following paragraph from Santisas: "Because plaintiffs complaint includes a claim for breach of contract within the scope of section 1717, we must look to section 1717 to determine whether the seller defendants are `part[ies] prevailing on the contract' who may recover attorney fees incurred in the defense of that claim. As here relevant, subdivision (b)(2) of section 1717 provides: `Where an action has been voluntarily dismissed or dismissed pursuant to a settlement of the case, there shall be no prevailing party for purposes of this section.' *370 Under section 1717, therefore, the seller defendants are not `part[ies] prevailing on the contract' and may not recover the attorney fees they incurred in the defense of the contract claim." (Santisas v. Goodin, supra, 17 Cal.4th 599, 615, 71 Cal.Rptr.2d 830, 951 P.2d 399.) As counsel pointed out, it is, of course, true that Santisas concludes that "in voluntary pretrial dismissal cases, ... section 1717 bars recovery of attorney fees incurred in defending contract claims...." (Santisas, at p. 602, 71 Cal.Rptr.2d 830, 951 P.2d 399.) But this is not a voluntary pretrial dismissal case. Although the same principle would apply to a case in which the action was voluntarily dismissed pursuant to a settlement, the parties here contemplated that the case would not be dismissed until after the trial court had determined the attorney fees issue. The principles applicable to dismissal after settlement are therefore inapplicable to the situation here.
After discussing the section 1717 issue, our Supreme Court then reconsidered Olen, supra, 21 Cal.3d 218, 145 Cal.Rptr. 691, 577 P.2d 1031. Finding section 1717, subdivision (b)(2) to be a codification of the Olen holding, the court concluded that "Olen merely construed section 1717 and has been effectively superseded by the 1981 amendment of section 1717 codifying its holding." (Santisas v. Goodin, supra, 17 Cal.4th 599, 622, 71 Cal.Rptr.2d 830, 951 P.2d 399.) The court pointed out that plaintiffs dismissal of the complaint pursuant to a settlement agreement does not necessarily mean that defendant prevailed. Since we find this portion of Santisas particularly relevant, we quote it at length: "[W]e are of the view that the practical difficulties associated with contractual attorney fee cost determinations in voluntary pretrial dismissal cases are not as great as suggested by the majority in Olen, supra, 21 Cal.3d 218, 145 Cal.Rptr. 691, 577 P.2d 1031. The Olen majority soundly reasoned that attorney fees should not be awarded automatically to parties in whose favor a voluntary dismissal has been entered. In particular, it seems inaccurate to characterize the defendant as the `prevailing party' if the plaintiff dismissed the action only after obtaining, by means of settlement or otherwise, all or most of the requested relief, or if the plaintiff dismissed for reasons, such as the defendant's insolvency, that have nothing to do with the probability of success on the merits. The Olen majority also soundly reasoned that scarce judicial resources should not be used to try the merits of voluntarily dismissed actions merely to determine which party would or should have prevailed had the action not been dismissed. But we do not agree that the only remaining alternative is an inflexible rule denying contractual attorney fees as costs in all voluntary pretrial dismissal cases. Rather, a court may determine whether there is a prevailing party, and if so which party meets that definition, by examining the terms of the contract at issue, including any contractual definition of the term `prevailing party' and any contractual provision governing payment of attorney fees in the event of dismissal. If, as here, the contract allows the prevailing party to recover attorney fees but does not define `prevailing party' or expressly either authorize or bar recovery of attorney fees in the event an action is dismissed, a court may base its attorney fees decision on a pragmatic definition of the extent to which each party has realized its litigation objectives, whether by judgment, settlement, or otherwise. [Citation.]" (Santisas, at pp. 621-622, 71 Cal. Rptr.2d 830, 951 P.2d 399.)
This was essentially the procedure followed here, and we agree with plaintiffs that it was a proper one. The parties expressly agreed, on the record and in the written settlement agreement, to have the trial court determine whether there was a *371 prevailing party and, if so, determine which party prevailed, and then to award attorney fees accordingly. The trial court did so, and we find that the homeowners association thereby waived its current contention that this procedure was precluded by section 1717, subdivision (b)(2).
We therefore agree with Reveles that "where there is no dismissal, a settling party may move for contractually based attorney fees under section 1717 unless the right to them was expressly or impliedly waived in the settlement agreement. [Citation.]" (Reveles v. Toyota by the Bay, supra, 57 Cal.App.4th 1139, 1150, 67 Cal. Rptr.2d 543.) At oral argument, defense counsel disagreed, citing Exxess Electronixx v. Heger Realty Corp. (1998) 64 Cal. App.4th 698, 75 Cal.Rptr.2d 376. In that case, involving a standard commercial lease, the court concluded that section 1717 precluded an award of attorney fees on the contract claim. (Exxess, at p. 702, 75 Cal.Rptr.2d 376.) In discussing section 1717, the court held that subdivision (b)(2) means that "an award of attorneys' fees is not permitted where an action `on a contract' has been dismissed as part of a settlement." (Exxess, at p. 707, 75 Cal. Rptr.2d 376.) Even though the lease contemplated an award of attorney fees to the prevailing party in the event of a settlement, the court held that "the definition of `prevailing party' in ... section 1717 is mandatory and cannot be altered or avoided by contract." (Exxess, at p. 707, 75 Cal.Rptr.2d 376.) In that case, the settlement provided that the broker, Heger Realty, retained the right to move for costs and attorney fees in the action. The cross-complaint was then dismissed, and Heger subsequently filed a cost memorandum seeking attorney fees. (Exxess, at pp. 707-708, 75 Cal.Rptr.2d 376.)[6]
This case is different. In this case there was no dismissal before the determination of the attorney fee issue. Instead, as defense counsel stated on the record, "And the court will resolve that particular matter [the attorney fees claim] and that is not resolved by this particular settlement. That is an open issue and it's subject to the determination of the court, in which event the dismissal with prejudice will have to await resolution of that particular issue until it's resolved." The settlement agreement expressly confirmed the possibility of an award of attorney fees by the agreement of the parties to refer the issue to the trial court for determination: "The Parties have agreed to reserve the issue of any award of costs and attorneys fees to Plaintiffs, as requested by Plaintiffs in their respective Complaints, for consideration by this Court upon Plaintiffs filing the necessary Motion and/or Memorandum of Costs with the Court."[7]
The settlement agreement, including this provision, was, of course, enforceable under Code of Civil Procedure section 664.6.[8] Either party could therefore seek *372 a judgment incorporating the terms of the settlement or either party could seek to compel compliance with the terms of the settlement. Under the settlement agreement, the action would not be dismissed until the various actions contemplated in the agreement had been taken. Once those actions had been taken, and the attorney fee issue resolved, the agreement provides for the filing of a dismissal with prejudice. There has therefore been no dismissal to date, and no final judgment in the action.
Since all substantive issues in the case, except for the award of attorney fees, have been resolved by the settlement agreement, the trial court could determine the prevailing party, or it could exercise its discretion under section 1717 and decide that there was no prevailing party.[9] It determined that plaintiffs were prevailing parties. We now turn to a consideration of the homeowners association claim that it erred in doing so.

THE PREVAILING PARTY DETERMINATION
In Coltrain, this court quoted Olen, supra, 21 Cal.3d 218, extensively and held, in the context of a SLAPP suit, that the trial court has the discretion to determine which party prevailed under Code of Civil Procedure section 425.16. We held that "the critical issue is which party realized its objectives in the litigation. Since the defendant's goal is to make the plaintiff go away with its tail between its legs, ordinarily the prevailing party will be the defendant. The plaintiff, however, may try to show it actually dismissed because it had substantially achieved its goals through a settlement or other means, because the defendant was insolvent, or for other reasons unrelated to the probability of success on the merits." (Coltrain v. Shewalter, supra, 66 Cal.App.4th 94, 107, 77 Cal.Rptr.2d 600.)
Section 1717, subdivision (b)(1) provides that "[t]he court ... shall determine who is the party prevailing on the contract for purposes of this section, whether or not the suit proceeds to final judgment. Except as provided in paragraph (2), the party prevailing on the contract shall be the party who recovered a greater relief in the action on the contract. The court may also determine that there is no party prevailing on the contract for purposes of this section."
In Sears v. Baccaglio, supra, 60 Cal. App.4th 1136, 70 Cal.Rptr.2d 769, the court reviewed the legislative history of section 1717 and concluded that "the continuing theme of the Legislature's discussion of section 1717 has been the avoidance of narrowly defined procedures, which have been seen as favoring the dominant party, in favor of an equitable consideration of who should fairly be regarded as the winner." *373 (Sears, at pp. 1147-1148, 70 Cal.Rptr.2d 769.)
Elaborating on this statement, the court explained that "[t]he history of section 1717, as set forth above, consistently adheres to the theme of equity in the award of fees and demonstrates legislative intent to expand the original ambit of the statute by the addition of provisions allowing the court to determine the prevailing party as well as the reasonableness of the fees to be awarded. Because the statute allows such discretion, it must be presumed the trial court has also been empowered to identify the party obtaining `a greater relief by examining the results of the action in relative terms: the general term `greater' includes `[l]arger in size than others of the same kind' as well as `principal' and `[s]uperior in quality.' [Citation.]" (Sears v. Baccaglio, supra, 60 Cal.App.4th 1136, 1150-1151, 70 Cal.Rptr.2d 769.)
Thus, "[w]hen deciding who prevailed under section 1717, `"... equitable considerations must prevail over both the bargaining power of the parties and the technical rules of contractual construction."' [Citation.]" (Sears v. Baccaglio, supra, 60 Cal.App.4th 1136, 1151, 70 Cal.Rptr.2d 769.) The trial court has broad equitable discretion to determine which party prevailed, or to determine that there was no prevailing party in a particular situation. (Id. at p. 1152, 70 Cal.Rptr.2d 769.)
The Sears court relied on Hsu v. Abbara (1995) 9 Cal.4th 863, 876, 39 Cal.Rptr.2d 824, 891 P.2d 804, in which our Supreme Court adopted the following standard for interpretation of section 1717: "[W]e hold that in deciding whether there is a `party prevailing on the contract,' the trial court is to compare the relief awarded on the contract claim or claims with the parties' demands on those same claims and their litigation objectives as disclosed by the pleadings, trial briefs, opening statements, and similar sources. The prevailing party determination is to be made only upon final resolution of the contract claims and only by `a comparison of the extent to which each party ha[s] succeeded and failed to succeed in its contentions.' [Citation.]" In that case, the Supreme Court found that the judgment was a simple win for one party on the contractual claims, and that party was therefore entitled to attorney fees under section 1717.
The trial court had no discretion to deny attorney fees in that situation but, as the court stated: "We agree that in determining litigation success, courts should respect substance rather than form, and to this extent should be guided by `equitable considerations.' For example, a party who is denied direct relief on a claim may nonetheless be found to be a prevailing party if it is clear that the party has otherwise achieved its main litigation objective. [Citations.]" (Hsu v. Abbara, supra, 9 Cal.4th 863, 877, 39 Cal.Rptr.2d 824, 891 P.2d 804.)
We apply this standard to the fee determination in this case. Plaintiffs argue that they achieved their main litigation objective by obtaining an order modifying the CC & R's to eliminate the provision which had effectively prevented them from renting their property. They also contend that they prevailed on the issue of the authority of the homeowners association to amend the CC & R's. Thirdly, they rely on the fact that they received $2,500 under the settlement agreement. While admittedly a nominal amount, they argue that they thereby received a net monetary recovery in the action which exceeded any recovery by defendants.
The homeowners association argues that plaintiffs are not prevailing parties because they did not obtain most of the relief they requested on their contract claim. Specifically, the homeowners association *374 argues that the $2,500 settlement was a nuisance value payment for settlement of the entire action. The payment did not relate specifically to the contract cause of action and the homeowners association points out that plaintiffs did not even seek monetary damages in their contract cause of action. The homeowners association also argues that plaintiffs did not obtain any injunctive relief as requested in the complaint.
In addition, we note that the trial court's original judgment was that plaintiffs take nothing, and that they were not entitled to any relief or damages. This judgment against plaintiffs was affirmed on appeal, although we did modify the CC & R's to delete the ownership restriction.
Neither argument is dispositive. It should be clear from the foregoing that this was not a case in which there was a clear win by either side. Both sides claim victory, and substantial arguments support both sets of claims. Accordingly, we find that the issue falls within the trial court's broad equitable discretion. No abuse of discretion has been shown, and the trial court's award of attorney fees to plaintiffs must therefore stand.[10]
At oral argument, defense counsel contended that we applied the wrong standard of review in making this determination. Counsel argued that the proper standard of review was a de novo review. Applying this standard of review, counsel urged us to find that there was no prevailing party as a matter of law.
Counsel relies on Khajavi v. Feather River Anesthesia Medical Group (2000) 84 Cal.App.4th 32, 100 Cal.Rptr.2d 627. In that case, the court said: "The determination of whether there exists a `legal basis for an award of attorney fees is a question of law which we review de novo' where the facts are undisputed. [Citations.]" (Khajavi, at p. 59, 100 Cal.Rptr.2d 627.) The issue in that case was whether an oral employment agreement contained an attorney fee provision because of similar written agreements with other employees. The court held there was no mutual consent to an attorney fee provision because the parties had never discussed it, and had not agreed to any such provision.
Defense counsel is correct that the prevailing party issue may be determined as a matter of law when there is a "simple, unqualified win" by one party. (Hsu v. Abbara, supra, 9 Cal.4th 863, 875-876, 39 Cal.Rptr.2d 824, 891 P.2d 804.) In such a case, the trial court has no discretion to deny the claim under section 1717. (Ibid.) "When a party obtains a simple, unqualified victory by completely prevailing on or defeating all contract claims in the action and the contract contains a provision for attorney fees, section 1717 entitles the successful party to recover reasonable attorney fees incurred in prosecution or defense of those claims. [Citation.]" (Scott Co. v. Blount, Inc. (1999) 20 Cal.4th 1103, 1109, 86 Cal.Rptr.2d 614, 979 P.2d 974; RTC Mortgage Trust v. Shlens (1998) 62 Cal. App.4th 304, 327-328, 72 Cal.Rptr.2d 581.) But in the more complicated case, the trial court has discretion: "If neither party achieves a complete victory on all the contract claims, it is within the discretion of the trial court to determine which party prevailed on the contract or whether, on balance, neither party prevailed sufficiently to justify an award of attorney fees." (Scott, at p. 1109, 86 Cal.Rptr.2d 614, 979 P.2d 974.)
The issue here is not whether there was an agreement containing an attorney fee provision, but rather whether the trial *375 court erred in determining the prevailing party. We therefore apply the standard stated in Reveles: "The court's determination a party prevailed on a contract action is an exercise of discretion which should not be disturbed on appeal absent a clear showing of abuse. [Citation.]" (Reveles v. Toyota by the Bay, supra, 57 Cal.App.4th 1139, 1153, 67 Cal.Rptr.2d 543; Hilltop Investment Associates v. Leon (1994) 28 Cal.App.4th 462, 466, 33 Cal.Rptr.2d 552.) As noted above, no such showing has been made here.

DISPOSITION
The judgment is affirmed. Plaintiffs are to recover their costs on appeal. The case is remanded for the trial court to consider any further requests for attorney fees pursuant to the terms of the settlement agreement.[11]
We concur: McKINSTER, J. and WARD, J.
NOTES
[1]  Unless otherwise indicated, all further statutory references are to the Civil Code.
[2]  The case was consolidated for all purposes with another action which sought similar relief. The issues raised by that action are not generally relevant to the issues on this appeal. However, the trial court judgment was reversed as to the other plaintiffs, Kross and Turner, and subsequent transcript references to plaintiffs apparently refer to both sets of plaintiffs.
[3]  The CC & R's stated: "This Subdivision shall be a Senior Citizen Development and at least one of the owners of each home shall be at least 55 years or older, and reside on the premises."
[4]  Other cases interpret section 1717 more broadly than merely providing a reciprocal right in a unilateral situation. (See, e.g., Santisas v. Goodin (1998) 17 Cal.4th 599, 614, 71 Cal.Rptr.2d 830, 951 P.2d 399; Sears v. Baccaglio (1998) 60 Cal.App.4th 1136, 1143-1149, 70 Cal.Rptr.2d 769.) The difference is not material in this case.
[5]  Disapproved on other grounds in Snukal v. Flightways Manufacturing, Inc. (2000) 23 Cal.4th 754, 775, footnote 6, 98 Cal.Rptr.2d 1, 3 P.3d 286.
[6]  While we agree that the definition of "prevailing party" cannot be modified by contract, there was no such modification in this case.
[7]  We agree with defendant's contention at oral argument that, even though the settlement agreement did not mention a prevailing party determination, it did contemplate the possibility of an award of attorney fees in compliance with applicable law. The trial court determined that plaintiffs were the prevailing parties under section 1717, and we have found that section 1717, subdivision (b)(2) does not preclude such an award.
[8]  That section provides: "If parties to pending litigation stipulate, in a writing signed by the parties outside the presence of the court or orally before the court, for settlement of the case, or part thereof, the court, upon motion, may enter judgment pursuant to the terms of the settlement. If requested by the parties, the court may retain jurisdiction over the parties to enforce the settlement until performance in full of the terms of the settlement."

Since the settlement agreement itself contained an attorney fee provision entitling the party prevailing on actions taken to enforce the agreement to an award of attorney fees, the trial court could apply that provision to award attorney fees to the party that prevails on the controversy over the meaning of the settlement agreement.
[9]  We therefore agree with plaintiffs that neither the trial court nor this court is bound by section 1717, subdivision (b)(2), because no voluntary dismissal has yet been entered, and the case has not yet been dismissed pursuant to the settlement agreement. (Reveles v. Toyota by the Bay, supra, 57 Cal.App.4th 1139, 1150-1151, 67 Cal.Rptr.2d 543.)
[10]  We note that the trial court did not award attorney fees for the period from the filing of the action in 1994 through June 28, 1996. It awarded fees for the period from June 28, 1996 through August 2000 in the sum of $23,569.32.
[11]  As noted above, the settlement agreement itself contains an attorney fee provision in favor of the prevailing party. The trial court may therefore award additional attorney fees to plaintiffs for their efforts in enforcing the provisions of the settlement agreement.
