
93 Cal.App.2d 729 (1949)
FRANK C. WEAVER, Petitioner,
v.
SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent.
Civ. No. 14204. 
California Court of Appeals. First Dist., Div. One.  
Sept. 23, 1949.
 Carroll, Davis & Freidenrich for Petitioner.
 Henry C. Clausen for Respondent.
 PETERS, P. J.
 By this proceeding in mandamus the petitioner seeks to compel the trial court to discharge a writ of attachment.
 The background of the dispute is as follows: On March 9, 1949, J. H. and Grace Davis, husband and wife, brought an action against Milton Meizel, petitioner Frank C. Weaver, Inter City Company and certain others, for $12,000 damages. The pleading is entitled "Complaint for Money after Rescission," *731 and alleges that Weaver engaged in business as the Inter City Company, a real estate corporation, and acted as agent for Meizel; that Meizel owned a lease on the Mariana Apartments in San Francisco; that he also owned the furniture and furnishings in the apartment; that Meizel desired to sell an interest in the lease and furniture and furnishings; that Meizel and Weaver represented to Davis and his wife that if they would purchase a one-half interest in the lease and the furniture and furnishings, that said apartments would be completely redecorated and refurnished; that the income from the apartments would be $2,400 a month gross, and $1,400 per month net; that the Davises would receive $200 a month and a free apartment for managing the apartment house, and half of the profits; that in reliance upon such representations the Davises entered into a contract on January 7, 1949, to buy a half interest in the lease and the furniture and furnishings, and paid to Meizel and Weaver $7,500 cash and a note for $1,500; that the representations were false and known by defendants to be false and made with intent to deceive; that the apartments were not refurnished and redecorated; that the gross income was not $2,400 a month but $1,400 to $1,500 a month, and the net income was not more than $100 per month; that on February 18, 1949, the Davises rescinded the contract and served upon defendants a notice of rescission and offer of restoration; that while the contract was in force the Davises performed labor and services of the reasonable value of $4,500. The prayer is for $12,000. There are five other causes of action. The second alleges a prior rescission based upon a failure of consideration through the fault of defendants; the third, a prior rescission based on failure of consideration caused by mutual mistake; the fourth alleges an account stated; the fifth sets forth a common count for money had and received; and the sixth a common count for services rendered. The contract executed by the parties and dated January 7, 1949, entitled "Agreement of Sale of Half Interest and Agreement of Partnership" is attached to the complaint as an exhibit. It shows that Meizel had a 10-year lease on the apartment, and owned the furniture and furnishings, but had given a chattel mortgage thereon to the landlord to secure the lease; that Meizel transferred to the Davises a one-half interest in the furniture, and furnishings, and the lease; that the parties were to become partners in the ownership of the personal property and in the operation of the apartment house; that the Davises paid Meizel $7,500 *732 cash and executed a promissory note for $1,500; that Davis and his wife were to act as managers and to receive $200 a month and a free apartment; that the apartments were to be redecorated at a cost estimated at $6,000 to be paid for from the profits of the partnership.
 Upon the filing of this complaint the Davises secured a writ of attachment. The affidavit supporting the request for the writ avers "that the defendants in the said action are indebted to plaintiffs in the sum of $12,000.00 ... over and above all legal setoffs or counterclaims upon an express and implied contract for the direct payment of money, to wit; rescinded contract; account stated; money had and received; services performed; and that such contract was made and is payable in this State, and that the payment of the same has not been secured by any mortgage or lien upon real or personal property, or any pledge of personal property." It also appears from the pleadings before us that the Davises, after giving the notice of rescission, immediately removed from the apartment and no longer have any of the property in their possession. The writ of attachment was levied on the bank account of Weaver which, at the time of the levy, contained $4,297.90. Weaver, thereupon, by motion, sought to have the attachment dissolved. The superior court denied the motion, whereupon this proceeding in mandate was instituted.
 [1] Preliminarily, it should be stated that mandamus is the proper remedy to secure the dissolution of a writ of attachment improperly issued where the lower court has improperly issued where the lower court has improperly denied a motion for discharge. (McCall v. Superior Court, 1 Cal.2d 527 [36 P.2d 642, 95 A.L.R. 1019].) [2] It is also the law that in determining the right to an attachment all of the facts set forth in the record before us must be considered, and that conclusions of law set forth in the affidavit used to secure the writ of attachment contrary to the pleaded facts in other pleadings will be disregarded. (Yosemite etc. Assn. v. Case-Swayne Co., 73 Cal.App.2d 806 [167 P.2d 541].)
 [3] It is now settled in this state that where a buyer is induced to enter into a contract of purchase by reason of fraud of the seller and rescinds, and where the buyer has received nothing of value, but brings an action for the consideration paid by him, such action is based on an implied promise to pay and is therefore ex contractu, and an attachment will lie. But if the buyer has received something of value, so that the failure of consideration is partial and not total, and has a lien on the property retained, no attachment *733 will issue. (McCall v. Superior Court, 1 Cal.2d 527 [36 P.2d 642, 95 A.L.R. 1019].)
 [4a] Thus, the real question involved in the present case is whether Davis and his wife had a lien on the furniture, furnishings and on the leasehold. If they did not, the attachment properly issued. If they had such a lien, the writ should be discharged. Petitioner contends that the Davises had a lien on the property covered by the contract by virtue of section 1789.5 of the Civil Code. That section provides that: "Where the buyer is entitled to rescind the sale and elects to do so, if the seller refuses to accept an offer of the buyer to return the goods, the buyer shall thereafter be deemed to hold the goods as bailee for the seller, but subject to a lien to secure the repayment of any portion of the price which has been paid, and with the remedies for the enforcement of such lien allowed to an unpaid seller by section 1773."
 Under the facts, the plaintiff did not have a lien by virtue of this section. Under the contract of sale Davis and his wife had a one-half interest in the furniture and furnishings and in the leasehold. Prior to the rescission they were half owners of the property, and, therefore, had no lesser interest in the nature of a lien. They discovered that they had been defrauded. [5] They could have rescinded and remained in possession of the apartment house and its contents. In such event the quoted section would apply, they would have had a lien, and no attachment could have been secured. [4b] But they were not required to follow this procedure. They elected to rescind, and simultaneously they elected to remove from the premises. Thus, at all times they were in possession of the property they were part owners, and at no time were they lienholders. The lien created by section 1789.5 of the Civil Code is obviously dependent on possession, because how otherwise could the buyer "hold the goods as bailee for the seller" as provided in the section? The section is a part of the Uniform Sales Act, and, as to this very section, it has been held that the lien thereby created is dependent on possession. (See Uniform Laws Annotated, 1 Sales (1948 Supp.), p. 341.) [6] It therefore follows that the averment in the affidavit that the obligation to repay was unsecured correctly states the true facts. Nor is this a case where Davis and his wife were required to aver that "such security has, without any act of the plaintiff, or the person to whom the security was given, become valueless." (Code Civ. Proc.,  537.) Such averment is only required where the plaintiff was once secured by a *734 lien and such security has become valueless. In the instant case Davis and his wife at no time had any security. The fact that they could have had a lien by retaining possession did not render their "security" valueless. Their failure to exercise their right to have had a lien cannot deprive them of the right to an attachment.
 [7] Petitioner also contends that Davis and his wife have a lien by virtue of section 3050 of the Civil Code, as interpreted in Montgomery v. Meyerstein, 186 Cal. 459 [199 P. 800]. That section, by its very terms, only applies to the purchaser "of real property." The sale of a lease for a term of years is not the sale of real property. (Potts Drug Co. v. Benedict, 156 Cal. 322 [104 P. 432, 25 L.R.A.N.S. 609]; Dabney v. Edwards, 5 Cal.2d 1 [53 P.2d 962, 103 A.L.R. 822]; Callahan v. Martin, 3 Cal.2d 110 [43 P.2d 788, 101 A.L.R. 871].)
 Since it appears from the record that Davis and his wife have no lien on the property, they had a legal right to attach. The alternative writ is discharged and the application for a peremptory writ is denied.
 Ward, J., and Bray, J., concurred.
 A petition for a rehearing was denied October 22, 1949, and the following opinion was rendered:
 PETERS, P. J.
 On this petition for rehearing it is urged that the opinion as written is predicated upon the theory that there was a simultaneous offer to rescind and delivery of the property, and that such theory is false. It is contended that the record shows that the Davises kept the personal property for five days after offering to rescind. It is then urged that during that period they had a lien under the provisions of section 1789.5 of the Civil Code, which, it is claimed, bars the right to an attachment.
 The record shows the following: The complaint and offer to rescind are silent as to the fact here involved. The affidavit filed in support of the attachment avers that the claim is unsecured. The petition for a writ of mandate filed in this court avers that the Davises "are secured by a lien." The verified answer of the Davises avers that they removed from the property and that "since said rescission have not had any of the real or personal property in their possession or under their control." After the oral argument, petitioner was permitted to file the affidavit of Meizel in which it is averred that the Davises kept the property for five days *735 before returning it. Thus, even if the facts be interpreted most strongly in favor of petitioner, the most that appears is that the Davises, who claimed to have suffered damage by reason of the acts of petitioner and Meizel, rescinded and offered to restore, stayed in possession for five days, then, long before filing their complaint, removed from the property. Under such circumstances, the Davises waived their lien and elected to proceed as they did. Certainly they had a legal right to waive their lien, and the fact that they did so clearly appears.
 [8] But, says petitioner, under such circumstances, under the provisions of sections 537 and 538 of the Code of Civil Procedure, the Davises were required to aver in their affidavit filed in support of their attachment, that they once had a lien, but that "such security has, without any act of the plaintiff, ... become valueless." Such an averment was not jurisdictional under the facts here disclosed. As pointed out in the opinion on file, "in determining the right to an attachment all of the facts set forth in the record before us must be considered." The affidavit averred that the claim was unsecured, and the facts disclosed by the entire record demonstrate the truth of that averment. Sections 537 and 538 have no application to the disclosed facts. Here the Davises could have had a lien, and perhaps did have one for a period of five days. They could have kept possession of the property and asserted their lien. But they elected to redeliver possession of the property and waive their lien. Certainly, they were not forever barred from an attachment because, perhaps, they had a lien for five days and then elected to waive it. Certainly, the person who must be considered in this proceeding as a wrongdoer should not be legally entitled to claim that a waiver is the making a security "valueless" within the meaning of the sections.
 The proper application of the sections is shown in Yosemite etc. Assn. v. Case-Swayne Co., 73 Cal.App.2d 806 [167 P.2d 541]. That was an appeal from an order discharging an attachment. The trial court discharged the attachment because the record before the court disclosed that the plaintiffs had a lien on 82,000 cases of peaches but sold 80,000 cases of the fruit. The plaintiff failed to aver that the lien on the 2,000 cases still in his possession without fault had become valueless. The appellate court, of course, affirmed the trial court, because the pleadings disclosed an existing effective *736 lien. In the instant case the pleadings disclose no lien, disclose that even if one existed it does not now exist, and that it does not exist because the Davises waived it.
 Ward J., and Bray, J., concurred.
